Help with notifying user of empty recordset in ASP
Im making a page where the user enters in some information to find a person in a directory database. They can search by first or last name and/or by classroom number (for an elementary school website). The problem Im having is if no results are found (meaning an empty record set) then how can I notify the user of this?
I had the following code before but it wasn't working properly:
Code:
<% if Not(rsResults.bof AND rsResults.eof) then
do while not rsResults.eof
%>
<tr>
<td><%= rsResults("firstName") %>
.
.
.
.
</td>
</tr>
<%
rsResults.movenext
loop
else
%>
<center> NO RESULTS FOUND </center>
<% end if %>
When there was just one result returned in the recordset it would show me the no results found. It seems like even tho there was still a record in the recordset, the rsResults was still at bof AND eof so it skipped straight to the else. Any ideas on how to properly test this, even if there is only 1 returned record in the record set?