Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check to see if recordset is empty

Status
Not open for further replies.
Jul 14, 2003
116
0
0
CA
How to I check to see if a recordset from a SELECT query is empty? I am getting the following error:

error '80020009'
Exception occurred.

And the only reason I can think of is because I have an if statement that checks a value from a recordset that is empty.
 
If rs.EOF AND rs.BOF Then
response.write "sorry, no records found"
else
'display your records
end if

BTW that error doesnt seem to me like empty record set...

-DNG
 
IF (rs.State <> 1_ THEN
Response.Write "Recordset is closed"
ELSE
IF rs.EOF THEN
Response.Write "Recordset is empty"
END IF
END IF
 
Is it possible that your've got a value but it is Null?

Sometimes you can get an error when you try to use a Null where a string or number is expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top