I have a simple vb.net app and I'm trying to update a one row Access table with data from some textboxes. This is a learning exercise for me as I am coming back from not programming for almost 10 years, and know there are lots of other ways to manage this data, but I'm just trying to understand different aspects of ADO.net a little better.
The ERROR I'm trapping is:
"Syntax error in UPDATE Statement"
Any thought's as to what is going on? (See CODE and stuff below)
Much Thanks, in advance!!!
Here's the Scheme printed from ACCESS showing the exact spelling of the database table and column names:
Table: MaxTime
Name Type Size
ID Long Integer 4
Container Text 10
Vehicle Text 10
Exterior Text 10
Interior Text 10
The SQL UPDATE string looks like this (from the debugger just before it's executed):
UPDATE MaxTime SET Container = '1111', Vehicle = '2222', Exterior = '3333', Interior = '4444';
And here's the code
Dim strSQL As String
strSQL = String.Concat("UPDATE MaxTime SET Container = '", txtMaxContainerTime.Text, "', Vehicle = '", txtMaxVehicleTime.Text, "', Exterior = '", txtMaxExteriorTime.Text, "', Interior = '", txtMaxInteriorTime.Text, "';")
Try
dbConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = ShowData.mdb")
dbCommand = New OleDbCommand(strSQL, dbConnection)
dbCommand.Connection.Open()
dbCommand.ExecuteNonQuery()
dbCommand.Dispose()
dbConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try