2个回答
展开全部
Private Sub Command1_Click()
Dim getmima As String, J As Integer, mima As String
'取得密码
With Adodc1
.ConnectionString = conn
.CommandType = 8
.RecordSource = "select * from login where username='" & userlogo & "'"
.Refresh
getmima = .Recordset.Fields("pass")
End With
'检确认密码与新密码是否一致
If Trim(Text1(2).Text) <> Trim(Text1(1).Text) Then
MsgBox "您输入的新密码与确认密码不符,请重新输入! ", vbExclamation, "提示"
Text1(1).Text = ""
Text1(2).Text = ""
Text1(1).SetFocus
Else
If DigestStrToHexStr(Text1(0)) = getmima Then
With Adodc1
.Recordset.Fields("pass") = DigestStrToHexStr(Text1(1))
.Recordset.Update
End With
MsgBox "非常好!密码已经修改完毕。请您牢记! ", vbExclamation, "提示"
Unload Me
Else
MsgBox "原密码不对,请确认后继续! ", vbExclamation, "提示"
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Text1(0).SetFocus
End If
End If
End Sub
追问
额,,为什么不行啊, 一直提示text1无赋值
展开全部
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询