Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Username Password Validation 1

Status
Not open for further replies.

DDTiff

MIS
May 29, 2002
48
US
Hi,

Can someone help me? Thank you in advance.

Even though I know that MS Access does provide the security, but I also want to create a login form that verifies the users by their username and password.

So, I created a table called tblLogin which has two fields: Username, Password. I also created a Login form that has a cboUsername, txtPasswd, and cmdLogin.

My goal is to ask the user to select the username from the cboUsername, key in the password in the txtPasswd, and press the cmdLogin. The code then verifies this user by matching the select cboUsername.value and txtPasswd.value with the username and password in the tblLogin.

My reasons for developing this capability because 1) I have many subforms within a form and I want to restrict the read & write capability based on the user validation. 2) I also want to restrict certain user from accessing certain forms in my DB.

Again, thank you in advance for your time and help.


V/R,

Diem
 
If you send an e-mail to jbehrne@hotmail.com I'll send you a copy of a db that has a login system built (it uses a user table with user id, user password, user level)

jbehrne

If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
jbehrne
I have sent you an e-mail requesting the database if you would be so kind

Regards

Paul
 
an easier method, which does not require the user to do anything but launch the db. this assumes that your company requires that only one user is logged a machine at one time, using their Windows logon ID.

have a table with UserID (windows logon id).
then also their access permissions.

on launch of db, you can read who the user is by using

=environ("Username")

you can match this to the ID's in the table and find what kind of permission they have.

if their ID is not in the table, they must notify you.

if you want more details, let me know and i will provide.

at the least, in the example you are talking about in your post, you can at least only ask for the password for the user who is logged on to the machine, instead of having them select from a combo box. this means that the user must be logged on to their computer with a valid windows id and password. what if someone just chooses John Smith and knows the password they are using in your db? then anyone can log on as him. but if only the person logged on properly on that machine can log on to your db, then that is more (tho not best) secure.
 
All these security workarounds are bad ideas. The capability to do exactly what you want is built into the User-Level Security in Access.

Get the security FAQ, either from MS or from my website. There's code right there that will allow you to determine whether or not your user is in a specific group. That is how you should determine whether or not certain controls are visible or enabled.

Reinventing the wheel only puts distance between you and the rest of the Access development community, vastly limiting the number of people who will be able to help you when you run into problems. It also means that you'll have a bunch of extra overhead in your applications, and absolutely no more security.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
gingerr

can you provide me with more details.

let me first make you aware of the bits I think I understand from your response.

I should create a table with two fields.

1) User ID (same as their windows logon)
2) permissions level (text or number) to use as (admin, data entry, read only) or using numbers like 1,2,3 where it would check the value before giving permissions. eg 1 might mean full access 2 might be read only etc.

once that is done I need to use the code you mentioned on the startup of the db like on a splash screen, where it only checks the current windows user against a list of names stroed in the DB if it doesnt exist in that list then give them the boot if they do then .....

does it let them straight through or do they need to enter a password.

I also will need to know how to use the code

some sample code would be very useful.

thanks in advance.

Idd
 
you might want to read thru this thread: thread702-442005
why dont you see if that is what you are looking for first. if it doesnt satisfy you, i will help more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top