请问在VB中,,怎样来做修改密码的功能,代码是什么啊?

来源:百度知道 编辑:UC知道 时间:2024/06/04 18:17:09
如在TEXT1.TEXT存储密码,而TEXT2.TEXT中输入要修改的密码,然后点修改密码按扭能把TEXT1中的内容改成TEXT2中所从新输入的密码,要求改的是代码的值,而不是文本框显示的值.谢谢了,,
是不是还有其他方法啊?谢谢赐教了,

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 &quo