我用ADO实现对Access数据库的操作,其中select 、delete 语句都能通过,但update 、insert语句却一直出错,请各位前辈帮忙!
表名:users 字段名(均为字符型) UserName、 PassWord 、DepartMent
其中UserName是关键列update 语句
UPDATE Users Set PassWord='12' where UserName='xxx'
insert 语句
INSERT INTO Users (PassWord,UserName,DepartMent错误提示是
实时错误 '-2147217900 (80040e14)'
Syntax error in UPDATE statement.
表名:users 字段名(均为字符型) UserName、 PassWord 、DepartMent
其中UserName是关键列update 语句
UPDATE Users Set PassWord='12' where UserName='xxx'
insert 语句
INSERT INTO Users (PassWord,UserName,DepartMent错误提示是
实时错误 '-2147217900 (80040e14)'
Syntax error in UPDATE statement.
update [users] set......
第二句:
insert into [users] (password,username,......) values(a,b,c......)
Dim theConnString As String
Dim SQLStr AS String
theConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=F:\Guanli\SInfo.mdb;Persist Security Info=True"
theConn.Open theConnString
SQLStr = "UPDATE Users Set PassWord='12' where UserName='xxx'"
RS.Open SQLStr, theConn, adOpenDynamic, adLockBatchOptimistic, 0
Dim theConnString As String
Dim SQLStr As String
theConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=F:\Guanli\SInfo.mdb;Persist Security Info=True"
theConn.Open theConnString
SQLStr = "UPDATE Users Set PassWord='12' where UserName='xxx'"Dim theComm As ADODB.Command
Set theComm.ActiveConnection = theConn
theComm.CommandText = SQLStr
theComm.ExecuteSet theComm = Nothing
Set theConn = Nothing
Dim theConnString As String
Dim SQLStr AS String
theConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=F:\Guanli\SInfo.mdb;Persist Security Info=True"
theConn.Open theConnString
SQLStr = "UPDATE Users Set PassWord='12' where UserName='xxx'"
theconn.execute sqlstr