Article ID: 201048
Article Last Modified on 7/13/2004
<%@ Language=VBScript %>
<HTML>
<BODY>
<%
DBLoc = "C:\Program Files\Common Files\System\msadc\Samples\advworks.mdb"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & DBLoc & ";"
strProductType = Request.Form("ProductType")
strSQL = "SELECT * FROM Products WHERE ProductType = '" & strProductType & "'"
Set objRS = objConn.Execute(strSQL)
%>
<TABLE>
<TR>
<%
For I = 0 To objRS.Fields.Count - 1
Response.Write "<TD><B>" & objRS(I).Name & "</B></TD>"
Next
%>
</TR>
<%
Do While Not objRS.EOF
Response.Write "<TR>"
For I = 0 To objRS.Fields.Count - 1
Response.Write "<TD>" & objRS(I) & "</TD>"
Next
Response.Write "</TR>"
objRS.MoveNext
Loop
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</TABLE>
</BODY>
<HTML>
WEB 1 http://server/application/SampleASPQuery.asp ProductType=["ProductType","Please enter a Product Type to search for:"]
WEB 1 http://server/application/SampleASPQuery.asp?ProductType=["ProductType","Please</WWLINK> enter a Product Type to search for:"]
162080: How to Programmatically Perform a Web Query
Additional query words: kbDSupport
Keywords: kbhowto kbinetdev KB201048