vb进销存系统修改密码的问题!!
Private Sub cmdOK_Click()
Dim txtSQL, MsgText As String
Dim mrc As ADODB.Recordset
If Trim(Text1(1).Text) <> Trim(Text1(2).Text) Then
MsgBox "密码输入不正确!", vbOKOnly + vbExclamation, "警告"
Text1(1).SetFocus
Text1(1).Text = ""
Else
txtSQL = "select * from user_Info where user_ID = '" & UserName & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.Fields(1) = Text1(1).Text
mrc.Update
mrc.Close
Me.Hide
MsgBox "密码修改成功!", vbOKOnly + vbExclamation, "修改密码"
End If
Text1(1).Text = ""
Text1(2).Text = ""
End Sub
错误提示为"BOF或EOF中有一个是真,或者当前的记录已被删除,所需的操作要求一个当前记录"
希望各位大侠积极指出错误
[解决办法]
应该是没记录的空数据库被要求修改记录的值
在mrc.Fields(1) = Text1(1).Text 的前面加一条 mrc.AddNew试试
[解决办法]
txtSQL = "update user_Info set 密码字段='"& text(1).text &"' where user_ID = '" & UserName & "'"
conn.execute txtsql