Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Unanswered: Login restrictions

    Hello,

    I got a project at school and I am making a database for a movie store.
    I want two different types of login at the store. One for the boss and one for the employees. How can I fix that when the boss logs on he got more options than if a employee logs on?
    Click image for larger version. 

Name:	access.jpg 
Views:	30 
Size:	46.4 KB 
ID:	9325

  2. #2
    Join Date
    May 2003
    Location
    UK
    Posts
    233
    I would attached the database but I cant zip it at the moment.

    This will get you in. From here in its simplest you could make controls visible or not depending on the users name using an if statement.

    Or you could you could create a group table and then assign users to those groups and display the groups they are assigned to on the menu using SQL query. I do have a database that does this if you get stuck
    Attached Files Attached Files

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you would need to know the bosses username

    the simple ansewer is to put some code behinf the forms on open event that detects whether that person has a sepcific privilige and take appropriate action

    eg
    if username="blah" then
    'set up for da boss
    else
    'setup for the troops
    endif

    getting the username of the boss can be difficult
    you can get the username using an API call (google Dev Ashish API, or look in the Access code bank for some routines from PKStormy). that will tell you the network name of the current user

    then you need to workout whether that person is a boss or an employee.

    you coudl do that by creating a table with userid's in
    eg
    Users
    Username string PK
    IsBoss boolean
    CanUse boolean

    then lookup that Username in the Users table..
    if CanUse is set then that username is allowed to tuse the application
    if IsBoss is set then that user has 'boss' privilege

    y'get the picture

    personally I'd do the lookup by qurerying that usernames privileges int he workgroup file, but thats a whole different ballgame
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Feb 2009
    Posts
    6
    I forgot to tell you that I am just creating the front end in Access and the database itself is created in MSSQL2008. I have created 3 logins in MSSQL, one admin, one IT-supervisor and one login for the employees.

    Can I do it the way you explain?

  5. #5
    Join Date
    May 2003
    Location
    UK
    Posts
    233
    I think the answer is Yes to both

Posting Permissions

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