用vb和access做个修改密码

来源:百度知道 编辑:UC知道 时间:2024/05/15 05:58:10
想请个高手帮我写个修改密码的代码,text1是帐号;text2是旧密码;text3是新密码;text4是确定密码.那个高手能帮帮忙,谢谢!

给你一个完整代码:
数据库 : Daily.mdb
资料表 :Login
栏位 : UserName 和 Password

Private Sub cmdchange_Click()
If Text1 = "" Then
MsgBox "Please fill username.", vbInformation + vbOKOnly, "Information"
Text1.SetFocus
Exit Sub
End If

If Text2 = "" Then
MsgBox "Please fill in old password.", vbInformation + vbOKOnly, "Information"
Text2.SetFocus
Exit Sub
End If

SQL = "select * from Login where UserName='" & Trim$(Text1.Text) & "'and " & "Password='" & Trim$(Text2.Text) & "'"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = SQL
Adodc1.Refresh

If Adodc1.Recordset.RecordCount <> 0 Then

If Text3 = "" Then
MsgBox "Please fill in new password.", vbInformation + vbOKOnly, "Information"