Password Changing for Users

C

Casey

I have a system that I recently produced. It has
multiple levels of security groups and users assigned to
those groups. I know that the user can changed user
password through using the tools, security option. Is
there a way to have the opening of the password change box
automated, so that the user could press on a button from a
form, and have the change password screen popup, have the
user change the password, then be able to just close that
screen and end up back at the form.

This is not something I really need to know, but I am
curious about it if you have any feedback.

Thank you,

Casey
 
J

John Crighton

Casey,

Yes, it can be done fairly easily.

Use something like the following...

HTH!

John.

Private Sub cmdPWChange_Click()
Dim Oldp As String
Dim Newp As String
Dim Conp As String
Dim U As User

On Error GoTo Trap

Oldp = "" & Form_frmPassChange.txtOld
Newp = "" & Form_frmPassChange.txtNew
Conp = "" & Form_frmPassChange.txtConfirm

If Newp = Oldp Then
MsgBox "Error - the old password and new password are
identical", vbExclamation
Exit Sub
End If

If Newp <> Conp Then
MsgBox "Please ensure that the new password and the
confirmation password are the same.", vbExclamation
Exit Sub
End If

Set U = DBEngine.Workspaces(0).Users(CurrentUser)
U.NewPassword Oldp, Newp

MsgBox "Password Successfuly Changed", vbInformation
DoCmd.Close

Exit Sub
Trap:
MsgBox "Password not changed - please ensure that your
old password is typed correctly.", vbExclamation
Resume Next

End Sub
 
C

croy

Casey,

Yes, it can be done fairly easily.

Use something like the following...

HTH!

John.

Private Sub cmdPWChange_Click()
Dim Oldp As String
Dim Newp As String
Dim Conp As String
Dim U As User

On Error GoTo Trap

Oldp = "" & Form_frmPassChange.txtOld
Newp = "" & Form_frmPassChange.txtNew
Conp = "" & Form_frmPassChange.txtConfirm

If Newp = Oldp Then
MsgBox "Error - the old password and new password are
identical", vbExclamation
Exit Sub
End If

If Newp <> Conp Then
MsgBox "Please ensure that the new password and the
confirmation password are the same.", vbExclamation
Exit Sub
End If

Set U = DBEngine.Workspaces(0).Users(CurrentUser)
U.NewPassword Oldp, Newp

MsgBox "Password Successfuly Changed", vbInformation
DoCmd.Close

Exit Sub
Trap:
MsgBox "Password not changed - please ensure that your
old password is typed correctly.", vbExclamation
Resume Next

End Sub


On Access 2002, the Dim, "Dim U As User" coughed up,

"User-defined type not defined."

Advice?

Thanks,
croy
 
D

Douglas J. Steele

croy said:
On Fri, 25 Jul 2003 04:47:13 -0700, "John Crighton"

On Access 2002, the Dim, "Dim U As User" coughed up,

"User-defined type not defined."

User is a DAO object. Unfortunately, Microsoft chose not to include a
reference to DAO by default in Access 2002 (nor 2000).

While in the VB Editor, go to Tools | References. Scroll through the list of
available references until you find the one for Microsoft DAO 3.6 Object
library. Check it, then close the dialog.
 
C

croy

User is a DAO object. Unfortunately, Microsoft chose not to include a
reference to DAO by default in Access 2002 (nor 2000).

While in the VB Editor, go to Tools | References. Scroll through the list of
available references until you find the one for Microsoft DAO 3.6 Object
library. Check it, then close the dialog.


Thanks, Douglas!

Will this be saved with the front-end, so that I can give a
copy to our field office, or must they duplicate the
excersize on their machine?

If it is saved with the front-end, does this affect the size
of the front-end db?
 
D

Douglas J. Steele

croy said:
Will this be saved with the front-end, so that I can give a
copy to our field office, or must they duplicate the
excersize on their machine?

References live in the MDB file, so they should not have to duplicate the
exercise. The exception is if they've got a different version of Access than
you (including different levels of service packs than you). In that case,
sometimes the References collection gets messed up. You can tell by going
into Tools | References: sometimes you'll see MISSING: in front of one (or
more) of the selected references at the top of the list. If that happens,
uncheck the references, then scroll through the list and reselect them.
If it is saved with the front-end, does this affect the size
of the front-end db?

Probably, but only by a few bytes. All that's stored is a pointer to the
library file.
 
C

croy

References live in the MDB file, so they should not have to duplicate the
exercise. The exception is if they've got a different version of Access than
you (including different levels of service packs than you). In that case,
sometimes the References collection gets messed up. You can tell by going
into Tools | References: sometimes you'll see MISSING: in front of one (or
more) of the selected references at the top of the list. If that happens,
uncheck the references, then scroll through the list and reselect them.


Probably, but only by a few bytes. All that's stored is a pointer to the
library file.


Thanks, Douglas. You got me going again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top