If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Login restrictions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-12-09, 05:49
Frankiee Frankiee is offline
Registered User
 
Join Date: Feb 2009
Posts: 6
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?
Login restrictions-access.jpg
Reply With Quote
  #2 (permalink)  
Old 03-12-09, 06:27
HelpMePlease HelpMePlease is offline
Registered User
 
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
File Type: doc Password.doc (135.0 KB, 48 views)
Reply With Quote
  #3 (permalink)  
Old 03-12-09, 06:33
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 10,525
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old 03-12-09, 06:33
Frankiee Frankiee is offline
Registered User
 
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?
Reply With Quote
  #5 (permalink)  
Old 03-12-09, 07:26
HelpMePlease HelpMePlease is offline
Registered User
 
Join Date: May 2003
Location: UK
Posts: 233
I think the answer is Yes to both
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On