I am trying to update records in an access database.
I get an error when ExecuteNonQuery fires off..
Dim DBCommand As OleDb.OleDbDataAdapter
Dim DBInsert As New OleDb.OleDbCommand()
Dim dbconn As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("DB.mdb;"
DBInsert.CommandText = "UPDATE Table" & _
"SET Field1 = '" & txtField1.Text & "'" & _
"Field2 = '" & txtField2.Text & "'" & _
"Field3 = '" & txtField3.Text & "'" & _
"Field4 = '" & txtField4.Text & "'" & _
"WHERE KeyID = '" & txtKeyID.Text & "'"
DBInsert.Connection = dbconn
DBInsert.Connection.Open()
DBInsert.ExecuteNonQuery()
DBInsert.Connection.Close()
Thanks in advance