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 语句的语法错误,请那位老大指点一下。谢谢!
数据更新出错