<%
' this code opens the database
ORDERBY=request.querystring("ORDERBY")
if ORDERBY = "" then
ORDERBY = "NAME"
end if
numrecords = "0"
set conn = Server.CreateObject("ADODB.Connection")
conn.open "DSN=GENESEE;uid=nothing;pwd=nothing"
sql = "select count(ID) from VET_Veterinarians where TYPE = 1 "
set rs = conn.execute(sql)
if not rs.eof then numrecords = rs(0)
sql = "select * from VET_Veterinarians where TYPE = 1 order by " & ORDERBY
set rs = conn.execute(sql)
'response.write("There are " & numrecords & " records listed.")
'//SECURITY TO MAKE SURE THE PAGE DOES NOT GET PROPOGATED IF NO RECORDS EXIST. SENDS USER TO searchfail.asp
If numrecords = "0" then
%>
No results match.
<%else%>
The following matched your search of "<%=SEARCH_TEXT%>":
There are <%=numrecords%> veterinarians listed. Click on a veterinarian for
clinic information.
Veterinarians
<%
' Now lets grab all the records
DO UNTIL rs.eof
' put fields into variables
ID=rs("ID")
NAME=rs("NAME")
XTYPE=rs("TYPE")
ID_CLINIC=rs("ID_CLINIC")
%>