I am trying to update a column in a MS Access 2007 database via VB.NET Express 2010. But my code is causing an error
0x80040E14 syntax error in update statement
I don't know where I had done mistake. Please help me in finding the problem.
Here is my code.
Dim ole As New OleDb.OleDbConnection
ole.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=""C:\Documents and Settings\Admin\My Documents\Visual Studio 2010\Projects\test\LM.accdb"";Jet OLEDB:Database Password=9876543210;"
Dim reader As New Integer
Dim query As New OleDb.OleDbCommand
Dim cmdUpdate As New OleDb.OleDbCommand
Dim queryString As String
Try
ole.Open()
queryString = "update security set password = '" + MaskedTextBox2.Text + "' where username = '"+ TextBox1.Text +"' "
query.CommandText = queryString
query.CommandType = CommandType.Text
query.Connection = ole
query.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
ole.Close()
End Try
Try this:
queryString = "update security set [password] = '" + MaskedTextBox2.Text + "' where [username] = '"+ TextBox1.Text +"' "
User contributions licensed under CC BY-SA 3.0