Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Allow users to change password on secure DB (Access 2000)

    Without me going into detail, can I be guided advice wize into whats the best way to allow users to change there password on a user level secure DB.

    Say they forget their Password. The admin will clear the users password. Is it expected of the user to find the dialog in the tools menu to go add anew password themselves, or is there code or other methods to prompt for a password or activate the dialog automatically??

    Tx
    Regards,
    Rudi

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Allow users to change password on secure DB (Access 2000)

    You can create a form in which the user can change the password. Put three text boxes on the form, all with Password as Input Mask, so that the text entered by the user is displayed as asterisks. The first box is for the old password, the second for the new password and the third for the new password too, as confirmation.
    Also put two command buttons on the form, with captions OK and Cancel. The Cancel button merely closes the form. The OK button checks whether the contents of the second and third text boxes are equal, and puts up a warning if not (use Option Compare Binary at the top of the module instead of the default Option Compare Database - string comparison should be case sensitive here!). You can also check the new password for a minimum length, if you wish.
    If the new password is OK, set it as follows:

    DBEngine.Workspaces(0).Users(CurrentUser).NewPassw ord Me.txtOldPassword, Me.txtNewPassword

    where txtOldPassword and txtNewPassword are the first and second text box on the form, respectively.
    This is DAO code, so you need a reference to the Microsoft DAO 3.6 Object Library.
    An error will occur if the old password is incorrect, so you'll want to add error handling.

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Allow users to change password on secure DB (Access 2000)

    Hans. Again you exceed my expectations. Thanx for this very comprehensive answer. I will attempt this advice and reply if I have any hiccups.
    Regards,
    Rudi

  4. #4
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Allow users to change password on secure DB (Access 2000)

    Sorry...just another angle on the original Q.

    When I'm in the macro design window, I can choose RunCommand, and the properties window gives all the other lists of commands. Which one will activate the dialog (User and Group Accounts) that provides the tab to change the password. I remember doing it in the past, but I cant find the dialog command. If its only available in VBA, what is the command there... ie.. Application.dialogs???

    Tx
    Regards,
    Rudi

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Allow users to change password on secure DB (Access 2000)

    In a macro, use the UserAndGroupAccounts action. <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20>
    In VBA, use RunCommand acCmdUserAndGroupAccounts

  6. #6
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Allow users to change password on secure DB (Access 2000)

    Perfect! Tx
    Regards,
    Rudi

  7. #7
    New Lounger
    Join Date
    Jan 2004
    Location
    Salem, Oregon, USA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allow users to change password on secure DB (A

    I just wanted to say "Thanks" Hans. Once more, you have pulled me out of a mess, with a clear, concise and correct answer. You're the best. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •