syntax error in update statement

  • Thread starter Thread starter nigelsvision
  • Start date Start date
N

nigelsvision

Guest
Private Sub UpdateUser_Click_1(sender As Object, e As EventArgs) Handles UpdateUser.Click

sql = String.Format("UPDATE into tblContacts")
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "database1")

MaxRows = ds.Tables("database1").Rows.Count
inc = -1
Dim cb As New OleDb.OleDbCommandBuilder(da)
UpdateUser.Text = CStr(ds.Tables("database1").Rows(0).Item(4))
da.Update(ds, "database1")
MsgBox("Data updated")
End Sub

Dim ds As New DataSet
Dim dbProvider As String
Dim dbSource As String
Dim inc As Integer
Dim con As New OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim WelcomeName As String
Dim MaxRows As Integer
Dim UserTimer As Integer



Hi the code above tells me I have a syntax error in Update statement.

I am using a windows form, I have created a button on the form called "UpdateUser" and inserted the code below. The idea is that when the button is clicked it will update my table called "tblContacts" in my database called "Database1" with the data I have in a TextBox.

The problem is I get the error
"Syntax error in UPDATE statement"
Is there someone who can put me right on this as Im still on a learning path.
Thanks NIge

Continue reading...
 
Back
Top