标题:数据更新出错
只看楼主
szhtszx
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-1-22
 问题点数:0 回复次数:0 
数据更新出错

Private Sub XiuGaiPassword()
Dim objCmd As OleDb.OleDbCommand = CType(oledbCN.CreateCommand, OleDbCommand)
objCmd.CommandType = CommandType.Text
objCmd.CommandText = "select * from usysuser "
Dim strWhere As String
strWhere = Me.txtUserid.Text
Dim objDataSet As New DataSet("usysuser")
Dim objDa As New OleDb.OleDbDataAdapter(objCmd)
Dim objDaUp As New OleDbCommandBuilder(objDa)
objDa.Fill(objDataSet, "usysuser")
objDataSet.Tables("usysuser").PrimaryKey = New DataColumn() {objDataSet.Tables("usysuser").Columns("userid")}
objDataSet.Tables("usysuser").Rows.Find(strWhere)
objDataSet.Tables("usysuser").Rows(3).Item("password") = CStr(Me.txtPassword.Text)
If objDataSet.HasChanges = True Then
Try
objDa.Update(objDataSet, "usysuser")
objDa.AcceptChangesDuringUpdate = True '在调用UPDATA后调用AcceptChanges
Catch ex As OleDbException
MsgBox(ex.Message)
objDataSet.RejectChanges()
objDa.ContinueUpdateOnError = True
End Try
End If
End Sub

以上代码错误提示为“
UPDATE 语句的语法错误,请那位老大指点一下。谢谢!

搜索更多相关主题的帖子: 数据 
2007-09-29 21:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-174143-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.362515 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved