Check if a RecordSet has Data
Before you can query for a recordset, you need to make sure it has data in it.
Public Function EmptyRS(ByRef adoRS As ADODB.Recordset) As Boolean
'Checks for an EMPTY RecordSet
On Error GoTo ErrHandler
EmptyRS = True
If Not adoRS Is Nothing Then
EmptyRS = ((adoRS.BOF = True) And (adoRS.EOF = True))
End If
Exit Function
ErrHandler:
EmptyRS = True
End Function
Special Instructions
This code originally appeared on AndreaVB.com, and has been republished here with the permission of Andrea Tincani.
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.