archer_coal
Well-known member
- Joined
- Apr 4, 2003
- Messages
- 96
whats wrong with this code? It halts at
Dim objDataReader As OleDbDataReader = dbCmd.ExecuteReader so i assume there is a problem with the dbCmd syntax but i dont see what it might be.
with this error : An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
Make the connection
Dim dbConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\data\20304aa1.mdb")
dbConn.Open()
Dim dbCmd As New OleDbCommand("SELECT * FROM April ORDER BY id", dbConn)
Dim objDataReader As OleDbDataReader = dbCmd.ExecuteReader
Try
objDataReader.Read()
lbx1.Items.Clear()
Do While objDataReader.Read
lbx1.Items.Add(objDataReader("id"))
Loop
objDataReader.Close()
Catch
End Try
Dim objDataReader As OleDbDataReader = dbCmd.ExecuteReader so i assume there is a problem with the dbCmd syntax but i dont see what it might be.
with this error : An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
Make the connection
Dim dbConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\data\20304aa1.mdb")
dbConn.Open()
Dim dbCmd As New OleDbCommand("SELECT * FROM April ORDER BY id", dbConn)
Dim objDataReader As OleDbDataReader = dbCmd.ExecuteReader
Try
objDataReader.Read()
lbx1.Items.Clear()
Do While objDataReader.Read
lbx1.Items.Add(objDataReader("id"))
Loop
objDataReader.Close()
Catch
End Try