Help with OleDbCommand Update Syntax Error

I am trying to update a record. I can update one field with the Update statement but if I try to update more than one even if I separate them with commas it still gives me the Update Syntax Error. Here’s the code:

 str = "Update TblManagers Set MgrName = '" & MgrNameTextBox.Text & "' Where ManagerID = " & Me.IdeaDataSet.TblManagers.Rows(row).Item("ManagerID") & "" Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection) Try cmd.ExecuteNonQuery() cmd.Dispose() myConnection.Close() Catch ex As Exception MsgBox(ex.Message) myConnection.Close() End Try 

I don’t know how to format the text do display the code correctly. The next column to edit would be “Position”.

submitted by /u/EpicShaggy
[link] [comments]

Leave a Reply