JohnM
Well-known member
I need to insert 39 values into an access database from a .net application. When I run my program I get an Systax error in the INSERT INTO statement. I have compare the access field names with the names I typed in the INSERT Statement and see no errors, I have checked the variable's (in the program) formats (integer, single, ect) with the formats in the database and they match.
The error trapping I have used is below. It doesn't tell me very specific information on where the error is. Is there something else I can add to the error trapping that would give me more specific information on where the error is? Thank you for your time. My eyes are going bugging trying to see a mistake.
One thing I am not very sure about though is the way to concatenate the lines because of the length of typing 39 variables. Part of it is shown here
& n1 & "','" & s0 & "',' " & o11 & "'" & _
John M
Try
Dim MyDataReader As OleDbDataReader = Objcommand.ExecuteReader
While MyDataReader.Read
MsgBox(MyDataReader.GetName(4).ToString)
MsgBox(MyDataReader.GetValue(4).ToString)
End While
MyDataReader.Close()
cnn1.Close()
Catch exc As System.Exception
MsgBox(" Reader " & exc.ToString)
End Try
The error trapping I have used is below. It doesn't tell me very specific information on where the error is. Is there something else I can add to the error trapping that would give me more specific information on where the error is? Thank you for your time. My eyes are going bugging trying to see a mistake.
One thing I am not very sure about though is the way to concatenate the lines because of the length of typing 39 variables. Part of it is shown here
& n1 & "','" & s0 & "',' " & o11 & "'" & _
John M
Try
Dim MyDataReader As OleDbDataReader = Objcommand.ExecuteReader
While MyDataReader.Read
MsgBox(MyDataReader.GetName(4).ToString)
MsgBox(MyDataReader.GetValue(4).ToString)
End While
MyDataReader.Close()
cnn1.Close()
Catch exc As System.Exception
MsgBox(" Reader " & exc.ToString)
End Try