i am having issues with an update query.
i normally use SQL 2005 but for this project i am using an access 2007 database
please can anyone point me in the right direction,
Dim con As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Try
con.ConnectionString = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=" & Database & ";Persist Security Info=False"
con.Open()
cmd.Connection = con
cmd.CommandText = "update tblUsers " & vbCrLf & _
"SET Password = @Password" & vbCrLf & _
"where ID= @ID"
cmd.Parameters.AddWithValue("@Password", Me.txtpassword1.Text)
cmd.Parameters.AddWithValue("@ID", _userid)
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Error while inserting record on table..." & ex.Message, "Insert Records")
Finally
con.Close()
End Try
MsgBox("you have changed your password")
someone please help this has stopped me in my tracks now for over a day
the error i get is syntax error in update statement.