I need to check if my SQL statement returned any results from the Access db I\'m using to store my data.
I have this code atm:
cn = New OleDbConn
Simple. Use the OleDbDataReader.HasRows Property after your call to ExecuteReader.
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Computing Project\database.mdb;")
cn.Open()
cmd = New OleDbCommand("SELECT * FROM(" & roomvar.ToLower() & ") WHERE (((" & roomvar.ToLower() & ".date)=" & Chr(34) & dtpDate.Value.Date & Chr(34) & "))", cn)
dr = cmd.ExecuteReader
hasRows = dr.HasRows
dr.Close()