|
- Private Sub Command1_Click()
- If IsNull(new_pwd1) Then
- MsgBox "请输入新密码!", vbCritical, "提示"
- End If
- If IsNull(new_pwd2) Then
- MsgBox "请再次确认新密码!", vbCritical, "提示"
- End If
- If new_pwd1 <> new_pwd2 Then
- MsgBox "新密码确认不正确!", vbCritical, "提示"
- new_pwd1.SetFocus
- new_pwd1 = ""
- new_pwd2 = ""
- End If
- Dim rs As New ADODB.Recordset
- Dim str As String
- str = "select * from 管理员 where 用户名='" & User & "'"
- rs.Open str, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
- If Not rs.EOF Then
- rs.Fields("用户名") = User
- rs.Fields("密码") = new_pwd1
- rs.Update
- rs.Close
- Set rs = Nothing
- MsgBox "您成功地修改了该用户!"
- Else
- MsgBox "wrong"
- End If
- Me.Visible = False
- End Sub
复制代码 |
|