点按钮修改一次成功之后如果不退出程序就再点按钮修改第二次密码的话就有问题
修改第二次输入的原密码不能是上次修改过的新密码,否则就提示原密码错误,等于说原密码还是第一次没有修改
前的密码。我估计是数据库没有刷新的缘故,谁能帮我改改,加一句刷新的语句什么的,让这个程序可以正常的连续修改密码
Private Sub isButton1_Click()
If Text2.Text = "" Then
MsgBox "原密码不能为空!", vbCritical + vbOKOnly, "警告"
Text2.SetFocus
Else
If Text3.Text = "" Then
MsgBox "新密码不能为空!", vbCritical + vbOKOnly, "警告"
Text3.SetFocus
Else
If Text4.Text = "" Then
MsgBox "确认密码不能为空!", vbCritical + vbOKOnly, "警告"
Text4.SetFocus
Else
If Text2.Text <> gtUser.UserPassWord Then
MsgBox "您输入的原密码有误!请重新输入!!", vbCritical + vbOKOnly, "警告"
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text2.SetFocus
Else
If Text3.Text <> Text4.Text Then
MsgBox "您两次输入的新密码不同!请重新输入!!", vbCritical + vbOKOnly, "警告"
Text3.Text = ""
Text4.Text = ""
Text3.SetFocus
Else
Dim lsSql As String
gdbConn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=CX;Initial Catalog=kaoqin"
gdbConn.Open
lsSql = "update login set PassWord=" & ConvSqlString(Text3)
lsSql = lsSql & " where Admin=" & ConvSqlString(Text1)
gdbConn.Execute lsSql
MsgBox "密码修改成功!", vbInformation + vbOKOnly, "提示"
Unload Me
gdbConn.Close
End If
End If
End If
End If
End If
End Sub