Very basic user login system

chris.f

New member
Local time
Today, 23:20
Joined
Sep 27, 2007
Messages
8
Hi,

Sorry if this has been covered before but I couldn't find a post on it anywhere.

I have a login form but am not sure where to go with it now. I want the "Login" button to look up the username in the table "users" and check the password with the one submitted in the form. After this has been authorised I have also created field "permissions" in the users table and I would like that permission to be assigned to the users session.

Thanks,

Chris Farrants
 
Bob,

Thanks for the sample, it does exactly what I needed :D. Just a quick question - what does the acNormal, acForm do in the login form code?

Thanks again,

Chris Farrants
 
acNormal is a constant that, when specified opens the form as a normal form, not datasheet, etc. It really isn't necessary, but I like to be explicit on my open form code.

acForm is just telling the close event what type of object to close.
 
login and permissions

i have to ask if u use the wizard to do this or if I only need to put the code in...
also i have 10 forms thatt I want to make only avaliable in editmode(user must not have access to design view) for all my forms without opening the all the time the user logs in! Is this possible?

also what if the user skips the login and just click on a form?
 
Last edited:
i have to ask if u use the wizard to do this or if I only need to put the code in...
There's a bit more to it than that. You have to have the users table, you also have to code for everything that they do that you want separated by user security level.
also i have 10 forms thatt I want to make only avaliable in editmode(user must not have access to design view) for all my forms without opening the all the time the user logs in! Is this possible?
The easiest way to do to this is to make it an MDE file (See Tools > Database Utilities > Make MDE File) so that they can't go into design mode of forms, reports and they can't see code or macros. If they have the full-version of Access they can still modify tables and queries though.
also what if the user skips the login and just click on a form?
You make sure to hide the database window and don't let them have access to it on the menu or tool bar.
 
hide database window

You make sure to hide the database window and don't let them have access to it on the menu or tool bar.

i have done that but once you open the form through the switchboard you can right click and view design mode!!!!
is there a way to disable the righ-click for all the users except the user "administrator"?


The easiest way to do to this is to make it an MDE file (See Tools > Database Utilities > Make MDE File) so that they can't go into design mode of forms, reports and they can't see code or macros. If they have the full-version of Access they can still modify tables and queries though.

If i do this will the administrator be able to switch to design view?
 
Last edited:
i have done that but once you open the form through the switchboard you can right click and view design mode!!!!
is there a way to disable the righ-click for all the users except the user "administrator"?
Use an MDE file


If i do this will the administrator be able to switch to design view?
The person who designs stuff will design on the MDB file and redistribute a new MDE file with changes.

If you want the distribution to happen automatically, check out my tool here:

http://www.access-programmers.co.uk/forums/showthread.php?t=111132
 
admin

no i need to have only 1 file and when a user logs in the moves must be limited(no design view), but when the administrator logs in he must be able to do whatever he wants!
 
MS Access has a built in authentication feature since the first version.

If you are using 2003 then use "Tools->Database Security".

If you are using 2007 version, try to find user permission command from customise tab dialogue.

After you set security, every time some one open the database, he is required to verify himself.

You can set roles, groups, permission in the built-in security setting, much better than using customised tables.

MS Access security is based on Jet security model, I think it has been depreciated in 2007 version.
 
security

i have already disabled the navigation pane from the left so that the user cannot jump directly to the switchboard before loging in BUT if the user that logs in is "Administrator"(only one administrator) then i want the right click to be enabled, else it must be disabled(this is the case a user logs in that is not the administrator!)
 

Users who are viewing this thread

Back
Top Bottom