DIGIT-ARC read-only archive · snapshot: July 23, 2026

Syntax error in UPDATE statement

1 post · originally from https://geek.digit.in/community/threads/syntax-error-in-update-statement.126669/

deepakgates
deepakgates Original post #1
May 9, 2010 at 11:33 AM
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."