错误代码 0x80040E14 更新语法错误 [英] Error Code 0x80040E14 update syntax error

查看:78
本文介绍了错误代码 0x80040E14 更新语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 VB.NET Express 2010 更新 MS Access 2007 数据库中的列.但我的代码导致错误

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 语法错误

0x80040E14 syntax error in update statement

我不知道我哪里做错了.请帮我找出问题所在.

I don't know where I had done mistake. Please help me in finding the problem.

这是我的代码.

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

推荐答案

试试这个:

queryString = "update security set [password] = '" + MaskedTextBox2.Text + "' where [username] = '"+ TextBox1.Text +"' "

这篇关于错误代码 0x80040E14 更新语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆