I'm not sure if I'm missing something here.
I'm tring to update the "Date" field in a record in an ACCESS database, using a form I designed in vb.net.
Everything else works fine but as soon as I try to send the date to the access form, I get an error saying there is a Syntax error in UPDATE statement.
As soon as I remove the part of the commandtext with date in it, it works absolutely fine. I have tried sending the date to ACCESS as a string rather than a date, but still no joy.
Here is the code I used:
The first field is a string, the next two are integers, the last is a date.
I looked through the books and the forum first but couldn't find what I was doing wrong here. Can anyone point me in the right direction?
I'm tring to update the "Date" field in a record in an ACCESS database, using a form I designed in vb.net.
Everything else works fine but as soon as I try to send the date to the access form, I get an error saying there is a Syntax error in UPDATE statement.
As soon as I remove the part of the commandtext with date in it, it works absolutely fine. I have tried sending the date to ACCESS as a string rather than a date, but still no joy.
Here is the code I used:
VB.NET:
objCmd.CommandText = "UPDATE tblPNS SET Off = '" & _
strOff & "', Spa = '" & m_Spa & "', Hre = '" & _
m_Hre & "', Date = '" & m_Date & _
"' WHERE Off = '" & strOff & "'"
The first field is a string, the next two are integers, the last is a date.
I looked through the books and the forum first but couldn't find what I was doing wrong here. Can anyone point me in the right direction?