password protection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avilash13
    New Member
    • Aug 2012
    • 1

    password protection

    how do i write a macro for password protecting my access database, by creating a separate table for username and password so that more than one users can be authorized to access the database and also the password sanctity is maintained by assigning separate username and password for each user
  • ariful alam
    New Member
    • Jan 2011
    • 185

    #2
    You can do it.

    1. Create a table called login has @list to field UserId and Password.
    2. Create a unbound form for login having two text box (UserID and Password) and two button (Log in and Cancel).
    3. Create a select query on login table that takes two parameters for loginid and password from the login form.
    4. Create a form from the query created.
    5. Make the queried form a sub form of the login form that not visible.
    6. Now Add a Macro to the login captioned button in login form.

    The marcro steps are given bellow.

    a. MsgBox in action if user id not given.
    b. StopMacro in action if user id not given.
    c. MsgBox in action if password not given.
    d. StopMacro in action if password not given.
    e. Requery in action
    f. MsgBox in action if user id and password in login form and user id and password in sub form not matched.
    or
    if user id and password in sub form null
    g. StopMacro in action if user id and password in login form and user id and password in sub form not matched.
    or
    if user id and password in sub form null
    h. MsgBox in action if user id and password in login form and user id and password in sub form matched.
    or
    if user id and password in sub form not null
    i. Close in action with object selected form, name selected login form name
    j. OpenForm in actin with object selected form, name selected form name that you like to open.

    Hope it's help you. :)

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Just be aware that because Access is both the client and server, any security you attempt to apply to an access database can be undone by any user with access to it.

      Comment

      Working...