?
Solved

Microsof Access Password[s]

Posted on 2014-08-05
5
Medium Priority
?
315 Views
Last Modified: 2014-08-06
we have an Access Database that uses a single password to get into the Db.

I need to change this so that each user [and we have 10] have their own passwords.

Now then, I am not an Access person but looking into the code I see this so, as a quick and dirty method would it be possible to just change the code to say: IF OR

the code is

 word = Forms![*security].[password]
   
    If word = "xxxxxxx" Then                   'password
    passworde = True
    DoCmd.Close
    DoCmd.RunMacro "autoexec.procedures" 'optional procedures
    Call hide_toolbars
    Call UserInfoGather
    Call LastUsed
   
    Else
    counter = counter + 1
    If counter <> 3 Then
    MsgBox "Incorrect Password Strike " & counter
    Else
    MsgBox "And Out"
    DoCmd.Close
    Exit Sub
    End If
    End If

Ideally I would like to do a proper job and have it so that each user would have a password linked to their PC signon which is in the tblUsers Table and make it so that they were forced to change password every x days, but I reckon that is a BIG job

Thanks in advance
0
Comment
Question by:Jagwarman
5 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 40241421
<<deally I would like to do a proper job and have it so that each user would have a password linked to their PC signon which is in the tblUsers Table and make it so that they were forced to change password every x days, but I reckon that is a BIG job >>

This is not built into Access.  You will need to create your own login form.

1. Create a table in the db, something like tblUsers.
2. Add a startup form, frmLogin.  
3. You just need a single control, password (be sure to set the input mask to password so it's not displayed.  Then add an OK and a cancel button.  "OK" tries to login, cancel quits the app.

4. Use the following code:

Private Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetUserNameA Lib "advapi32.dll" (ByVal lpBuffer As String, nSize As Long) As Long


Public Function WhoAmI(bReturnUserName As Boolean) As String

        ' Function returns either user name or computer name

        Dim strName As String * 255

10      If bReturnUserName = True Then
20        GetUserNameA strName, Len(strName)
30      Else
40        GetComputerNameA strName, Len(strName)
50      End If

60      WhoAmI = left$(strName, InStr(strName, vbNullChar) - 1)

End Function

 to retrieve the network user name (windows signon).   Past the code into a module, and call it something like "basUserUtilities".

5.  Now when they click OK, you do WhoAmI(True) to get the user name, look it up in tblUsers, and see if the password typed matches what's in the table.

6. Add a "PasswordLastSet" Date/time field in tblUsers.   At login, if they login sucessfully, make the first check if the current date - PasswordLastSet is > your change interval, then put up a frmChangePassword and make them type in a new password.   Reset the PasswordLastSet  date to Date().

That enough to get you going?

Jim.
0
 
LVL 36

Expert Comment

by:ste5an
ID: 40241420
What Access version? What back-end?
0
 

Author Comment

by:Jagwarman
ID: 40241719
Access 2010

What back-end?
 what does that mean?
0
 
LVL 36

Expert Comment

by:ste5an
ID: 40241948
Where do you store your data?

See also Split an Access database.
0
 
LVL 85
ID: 40241982
Note too that Peter's Software has a nice utility for this:

http://www.peterssoftware.com/las.htm
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question