I'm trying to recognize an SQL query that results in no available records from the recordset. When I enter a value that I know is not in the record set, I keep getting "There is a problem with the page you are trying to reach and it cannot be displayed." When I enter a value known to be in the record set, it locates and displays it properly.
Here is what I've got:
sql = "select * from PTJobs where " & Request.Form("Query"
set rs = Server.CreateObject("ADODB.RecordSet"
rs.open sql,conn
If rs.EOF and rs.BOF Then
Response.Write "Sorry, no records were found matching that criteria."
Call CloseClientDatabase
Response.End
else
do while not rs.eof
response.write "<br><font face='arial' size='2'>" & "<b>Title: </b>" & rs("Title" & "<br>" & " <b>Ad: </b>" & rs("Advertisement" & "<br>" & " <b>Location: </b>" & rs("Location" & "</font>" & "<br>_<br>"
Response.Write rs.recordCount
rs.movenext
loop
End If
Any help is greatly appreciated..
Thanks
Here is what I've got:
sql = "select * from PTJobs where " & Request.Form("Query"
set rs = Server.CreateObject("ADODB.RecordSet"
rs.open sql,conn
If rs.EOF and rs.BOF Then
Response.Write "Sorry, no records were found matching that criteria."
Call CloseClientDatabase
Response.End
else
do while not rs.eof
response.write "<br><font face='arial' size='2'>" & "<b>Title: </b>" & rs("Title" & "<br>" & " <b>Ad: </b>" & rs("Advertisement" & "<br>" & " <b>Location: </b>" & rs("Location" & "</font>" & "<br>_<br>"
Response.Write rs.recordCount
rs.movenext
loop
End If
Any help is greatly appreciated..
Thanks