Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to check that users Access password is not null? 1

Status
Not open for further replies.

planetdrouin

Technical User
Dec 29, 2001
36
US
I have a form that allows users to change their own passwords. However, I would like to add code upon startup which checks to make sure the users password (Access built-n security) is not null and if so open the change password form.

Does anybody know how to do this?

Thanks

Lawrence
 
You can't access the password directly to check, but here's something that should work:
Code:
Public Function UserHasPassword() As Boolean
    Dim ws As DAO.Workspace
    
    On Error Resume Next
    Set ws = DBEngine.CreateWorkspace("Temp", CurrentUser, "")
    If Err Then UserHasPassword = True
    Set ws = Nothing
End Function
This attempts to create a new workspace and log on as the current user with a blank password. If an error occurs, the user must have a non-blank password. Rick Sprague
 
Rick,

Your accolades as a top tipmaster are well deserved. The code worked like a charm. Thanks for your help.

Lawrence
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top