how can I check if my recordset is empty??

F

flavisimo

I am trying to set a variable 0 or 1 if my recordset1 is not empty
but this returns 1 even when my recordset1 should be empty, can
somebody help please?

<% If isNull(Recordset1) Then
dim valore
valore = 0
else
valore = 1
end if
%>
 
J

Jeff Boyce

The code you posted only Dim's "valore" if the first leg of your If...
statement evaluates true. Consider moving the Dim statement outside of the
If... statement.

One approach is to check to see if your recordset starts out at both the
beginning and end of the file:
If Recordset1.BOF and Recordset1.EOF Then
...
 
Top