Search Tools Links Login

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

About this post

Posted: 2019-09-13
By: BrianGillham
Viewed: 197 times

Categories

Visual Basic 6

Attachments

No attachments for this post

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.