Restaurant Inspections By Name
<%
Dim conn, myrs, restvalue, submit, rcount
set conn=Server.CreateObject("ADODB.Connection")
set myrs=Server.CreateObject("ADODB.Recordset")
submit=request.QueryString("submit")
conn.Open ("DSN=cabellrestinspect;UID=;PWD=;")
if submit="true" then
restvalue=Replace(Request.Form("restname"), "'", "''")
myrs.open "SELECT * FROM InternetQuery WHERE InternetQuery.NAME_OF_FACILITY Like '%" & restvalue & "%'",conn,3,3
rcount = myrs.recordcount
if rcount = 0 then
Response.Write("
No records found. Please Try again.")
Else
myrs.movefirst
Response.Write ("
| Name of Facility | Address | Date of Inspection | Non Criticals | Criticals | Remarks |
")
Do While Not myrs.eof
Response.Write ("| " & myrs("NAME_OF_FACILITY") & " | " & myrs("STREET_ADDRESS") & " | " & myrs("DATE_OF_INSPECTION")& " | " & myrs("NON_CRITICALS") & " | " & myrs("CRITICALS") & " | " & myrs("REMARKS") & " |
")
myrs.movenext
loop
end if
myrs.close
conn.close
Response.Write ("
")
end if
%>