Private Sub Command1_Click()
Adodc1.RecordSource = "select * from Admin where UserName='" + Trim(Form6.Text1.Text) + "'"
Adodc1.Refresh
If Text1.Text = Adodc1.Recordset.Fields(1) Then
If Text2.Text = Text3.Text Then
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(1) = Trim(Text2.Text)
Adodc1.Recordset.Update
Adodc1.Refresh
Adodc1.RecordSource = "select * from Admin"
Adodc1.Refresh
MsgBox ("密码修改成功!")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Else
MsgBox ("两次输入的密码不同,请重新输入!")
End If
Else
MsgBox ("密码错误!")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
End Sub
以上代码发生错误“BOF或EOF有一个为真,或当前记录已被删除,需要一个值”
Adodc1.RecordSource = "select * from Admin where UserName='" + Trim(Form6.Text1.Text) + "'"
Adodc1.Refresh
If Text1.Text = Adodc1.Recordset.Fields(1) Then
If Text2.Text = Text3.Text Then
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(1) = Trim(Text2.Text)
Adodc1.Recordset.Update
Adodc1.Refresh
Adodc1.RecordSource = "select * from Admin"
Adodc1.Refresh
MsgBox ("密码修改成功!")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Else
MsgBox ("两次输入的密码不同,请重新输入!")
End If
Else
MsgBox ("密码错误!")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
End Sub
以上代码发生错误“BOF或EOF有一个为真,或当前记录已被删除,需要一个值”