File: asp_example.txt
Size: 892
Date: Mon, 15 Jul 2019 12:10:14 +0200
Type: txt
Example ASP script to return list of Customers by state

Call example:

http:\\www.website.com\example.asp?state=MA
 
<%
Set cn = Server.CreateObject("ADODB.Connection")
 
cn.Provider = "ASAProv.90"
cn.Open "DATA SOURCE='EAS Demo DB V10';UID=dba;PWD=sql"
 
Set rs=Server.CreateObject("ADODB.Recordset")
 
strSQL = "SELECT * FROM CUSTOMER WHERE STATE = '" & _
         Request("state") & "' ORDER BY LNAME, FNAME ASC"
 
rs.Open strSQL, cn
 
do until rs.EOF
  Response.Write rs("id") & vbTAB & _
                 rs("fname") & vbTAB & _
                 rs("lname") & vbTAB & _
                 rs("address") & vbTAB & _
                 rs("city") & vbTAB & _
                 rs("state") & vbTAB & _
                 rs("zip") & vbTAB & _
                 rs("phone") & vbTAB & _
                 rs("company_name") & vbCRLF
  rs.MoveNext
loop
 
rs.Close
%>