Syntax error in UPDATE statement

Status
Not open for further replies.

deepakgates

Broken In
Hey im trying to update field password in a access database but obviously i cant
thats why i am here

here goes my effort

Imports System.Data
Imports System.Data.DataTable

Public Class change_password
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String

Private Sub change_password_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =lispwd.mdb"

con.Open()

sql = "SELECT * FROM tblpwd"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "lispwd")

con.Close()

End Sub

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

Dim cb As New OleDb.OleDbCommandBuilder(da)

ds.Tables("lispwd").Rows(0).Item(1) = newpwd.Text
da.Update(ds)
MsgBox("Password changed")

End Sub
End Class

end then error on da.update statement says "Syntax error in UPDATE statement."
 
Status
Not open for further replies.
Top Bottom