Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

Determine if any records are returned

If want to use the following to return a group of records from an access database.  How would i determine if any records were returned or not?


 Dim cn As New OleDbConnection(Global_Values.strConn)
        Dim cmd As New OleDbCommand(sSQL, cn)
        Dim dr As OleDbDataReader

        If cn.State = Data.ConnectionState.Closed Then
            cn.Open()
        End If

        dr = cmd.ExecuteReader
0
Mike_Stevens
Asked:
Mike_Stevens
  • 2
1 Solution
 
YZlatCommented:
While dr.Read

End while
0
 
YZlatCommented:
or

if dr.HasRows then

end if
0
 
strickddCommented:
or even

if dr.ReadI() then

end if
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now