salman_qau
May 10th, 2003, 04:03 AM
hi,
i have a problem in asp query using. i don't know how use select query using where clause in asp and access. my coad is also attach with this file plz if u can then help out me. i will be really thankful to u.
in this example i m taking data from a previous page by using dropdown box in form and then compare it from a data base named "azm" having table "category" and fields code, name and description. tell me how can i write the code.
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<% dim str
str=Request.form("select")
Dim strConnect
strConnect="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PNCA\azm.mdb;Persist Security Info=False"
Dim objCommand,objRs
Set objCommand=Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection=strConnect
objCommand.CommandType=adCmdText
objCommand.CommandText="SELECT code,name FROM category where name = "'&str&'"
Set objrs=objCommand.Execute
Set objCommand=Nothing
Set objrs=nothing
response.write(str)
%>
</body>
</html>
thanx....
salman.
i have a problem in asp query using. i don't know how use select query using where clause in asp and access. my coad is also attach with this file plz if u can then help out me. i will be really thankful to u.
in this example i m taking data from a previous page by using dropdown box in form and then compare it from a data base named "azm" having table "category" and fields code, name and description. tell me how can i write the code.
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<% dim str
str=Request.form("select")
Dim strConnect
strConnect="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PNCA\azm.mdb;Persist Security Info=False"
Dim objCommand,objRs
Set objCommand=Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection=strConnect
objCommand.CommandType=adCmdText
objCommand.CommandText="SELECT code,name FROM category where name = "'&str&'"
Set objrs=objCommand.Execute
Set objCommand=Nothing
Set objrs=nothing
response.write(str)
%>
</body>
</html>
thanx....
salman.