I have a access table with an ID field that is auto incremented.
Problem is, I cant seem to do update querys when i use the ID field.
I narrow my selection to the person I want to make the updates to and then grab the id of the row and assign it to playid.
Dim objCommand As New OleDbCommand("UPDATE Contacts WHERE ID = " & playid & _
" SET Firstname = " & StrConv(txtFirstname.Text, VbStrConv.ProperCase) & _
", MiddleName = " & StrConv(txtMiddleName.Text, VbStrConv.ProperCase) & _
", Surname = " & StrConv(txtSurname.Text, VbStrConv.ProperCase) & _
"", cnn)
I end up getting this error:
An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
I have found though, if I change the objcommand to update where the surname = something, it works fine.
Has anyone come across this or is it just me?
Thanks
Steve
Problem is, I cant seem to do update querys when i use the ID field.
I narrow my selection to the person I want to make the updates to and then grab the id of the row and assign it to playid.
Dim objCommand As New OleDbCommand("UPDATE Contacts WHERE ID = " & playid & _
" SET Firstname = " & StrConv(txtFirstname.Text, VbStrConv.ProperCase) & _
", MiddleName = " & StrConv(txtMiddleName.Text, VbStrConv.ProperCase) & _
", Surname = " & StrConv(txtSurname.Text, VbStrConv.ProperCase) & _
"", cnn)
I end up getting this error:
An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
I have found though, if I change the objcommand to update where the surname = something, it works fine.
Has anyone come across this or is it just me?
Thanks
Steve