当用户名和密码全正确输入后不能更新密码是怎么回事?也没有提示!
用户名Combo1
原密码Text2
新密码Text3
重新输入Text1
Private Sub Command1_Click()
txtsql = "select*from user where yonghuming='" & Combo1.Text & "'"
Set mrc = ExecuteSQL(txtsql, msgtext)
If mrc.EOF Then
MsgBox "没有这个用户,请重新输入!", vbOKOnly
Exit Sub
End If
If Text1.Text <> Text3.Text Then
MsgBox "两次输入密码不一致!请重新输入.", vbOKOnly
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Exit Sub
End If
If Text2.Text <> mrc.Fields(1) Then
MsgBox "原密码输入不正确,请重新输入!", vbOKOnly
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Else
If MsgBox("确定要更改密码吗?", vbYesNo + vbExclamation, "警告") = vbOK Then
txtsql = "update user set mima='" & Text3.Text & "' where yonghuming='" & Combo1.Text & "'"
Set mrc = ExecuteSQL(txtsql, msgtext)
MsgBox "更改成功!", vbOKOnly
Text2.Text = ""
Text1.Text = ""
Text3.Text = ""
Exit Sub
End If
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
i = 0
txtsql = "select * from user"
Set mrc = ExecuteSQL(txtsql, msgtext)
With Combo1
Do While Not mrc.EOF
i = i + 1
.AddItem Trim(mrc!yonghuming)
mrc.MoveNext
Loop
.ListIndex = i - 1
End With
mrc.Close
OK = False
miCount = 0
End Sub