Managing Passwords

To change a user's password, you execute the User object's NewPassword method. You must provide both the old and new passwords; however, if you are a member of the Admins groups and are changing the password of another user, the old password argument is ignored.

Public Sub ChangePassword(strUser As String, _

strOldPassword As String, strNewPassword As String) Dim wrk As DAO.Workspace Dim usr As DAO.User

Set wrk = DBEngine(O)

Set usr = wrk.Users(strUser)

'Change the password usr.NewPassword strOldPassword, strNewPassword

Set usr = Nothing Set wrk = Nothing End Sub

The issue, of course, is that there is no way to view the password for any user.

0 0

Post a comment