S
SCG
Am trying to read the primary key from an Access database table using
ExecuteScaler:
objSQLCommand = New OleDb.OleDbCommand
objSQLCommand.Connection = objConnection
objSQLCommand.CommandText = "SELECT PK_ID FROM tblBaz WHERE
FK_Item_ID=" & lintItemID & " AND Time_Sold=" &
cstrDateDelimiter & ldatDate & cstrDateDelimiter
lintID = objSQLCommand.ExecuteScalar()
(where cstrDateDelimiter is a constant "#")
I get the following error message on the ExecuteScalar command:
"A first chance exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll"
Can anyone a) tell me what I'm doing wrong or b) tell me how to get a
better idea of what the error is all about!?
Many Thanks
Sarah
ExecuteScaler:
objSQLCommand = New OleDb.OleDbCommand
objSQLCommand.Connection = objConnection
objSQLCommand.CommandText = "SELECT PK_ID FROM tblBaz WHERE
FK_Item_ID=" & lintItemID & " AND Time_Sold=" &
cstrDateDelimiter & ldatDate & cstrDateDelimiter
lintID = objSQLCommand.ExecuteScalar()
(where cstrDateDelimiter is a constant "#")
I get the following error message on the ExecuteScalar command:
"A first chance exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll"
Can anyone a) tell me what I'm doing wrong or b) tell me how to get a
better idea of what the error is all about!?
Many Thanks
Sarah