ASP Source Code:
<%Option Explicit%>
<!--#include file="ADOsetup.inc"-->
<%
DIM strSearch,strSort,strSQL
strSearch = Request.QueryString("txtSearch")
strSort = Request.QueryString("optSort")
strSQL = "Select * from Customers"
strSQL = strSQL & " WHERE Country = '" & strSearch & "'"
strSQL = strSQL & " ORDER BY " & strSort
ADOrs.Open strSQL, ADOcn
%>
<H2>Search Results (Version 4)</H2><BR>
<PRE>SQL string = [<%=strSQL%>]</PRE><BR>
<table border="1" width="80%">
<tr>
<th>Name</th>
<th>Company</th>
<th>City</th>
</tr>
<%do until ADOrs.EOF%>
<tr>
<td><%=(ADOrs.Fields("ContactName").Value)%>
<td><%=(ADOrs.Fields("CompanyName").Value)%>
<td><%=(ADOrs.Fields("City").Value)%>
<%ADOrs.MoveNext%>
</tr>
<%loop%>
</table>
<!--#include file="ADOclose.inc"-->