VB6.0+SQL
vb 修改用户密码出错 3021下面是我写的代码
Private Sub Command1_Click()
Dim conn As New ADODB.Connection
Dim mrc As New ADODB.Recordset
Dim txtSQL As String
If Trim(Text1.Text) = Trim(Text2.Text) Then
MsgBox "您输入的密码一样,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Exit Sub
End If
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Exit Sub
Else
txtSQL = "select * from 管理员表 where 管理员姓名='" & Login.dlName.Text & "'"
Set mrc = exesql(txtSQL)
mrc.Fields(1) = Text1.Text ‘’这是出错的地方
mrc.Update
mrc.Close
MsgBox "密码修改成功", vbOKOnly + vbExclamation, "修改密码"
Unload Me
Login.Show
End If
End Sub
第一次改能改成功可是再改就出现3021错误
运行时报错:实时错误3021,BOF或EOF中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录
请高手指教