"User ID" and "Password"

M

MaryAnn

Im sorry, I have done some research on how to protect a form with a
password, I found some info. but I dont quite understand it (Im a new
user in MS Access). I was wondering if anybody can help me, I would
appreciate it :) And secruity is also not a big issue.
First I would like to protect a form with a "User ID" and "Password"
using MS Access 2000.
I know that a table has to be created, with the fields "User ID" and
"Password"
Then a form needs to be created with the fields and a Login Button and
Close button, then on the login button the event procedure needs a
code.
I have found this code

Private Sub btnLogIn_Click()
Dim Password As Variant


Password = DLookup("Password", "Users", "UserID = '" & Me.txtUserID &
"' ")


If Nz(Password, "") = Me.txtPassword Then
DoCmd.Close
DoCmd.OpenForm "PasswordProtectedForm"
Else
MsgBox "Incorrect user ID or password"
End If


End Sub


The thing is that I dont know how to read this code, do I type what I
see?
Can anybody help me step by step on how to interpret this and how do I
put in the event procedure, do I erase what is alredy in the event
procedure? Maybe it would help if I told you my USER ID and PASSWORD-
User ID=MaryAnn Password=Keroppi1
Any help would be greatly appreciate it. Thank you and have a bless day

:) -MaryAnn


Reply
 
J

John Vinson

Im sorry, I have done some research on how to protect a form

Do you want to protect a Form? Or do you want to protect the data?
Remember, a Form is *just a window* - a tool to manage data stored in
Tables. An elaborate security scheme to protect a Form might be rather
like a high-priced deadbolt lock on your front door, with screen door
hooks on the side door and the kitchen door: the data in your tables
will NOT be protected.
with a
password, I found some info. but I dont quite understand it (Im a new
user in MS Access). I was wondering if anybody can help me, I would
appreciate it :) And secruity is also not a big issue.
First I would like to protect a form with a "User ID" and "Password"
using MS Access 2000.
I know that a table has to be created, with the fields "User ID" and
"Password"

And what's to keep a user from opening this table and printing out all
the userID's and passwords?
Then a form needs to be created with the fields and a Login Button and
Close button, then on the login button the event procedure needs a
code.

This will provide very limited security at a considerable amount of
effort.

Instead - I'd really recommend using the quite advanced security
module developed by Microsoft. Get the Security Whitepaper from

http://support.microsoft.com/kb/207793/en-us

Download it. Read it... *carefully*.

Sleep on it.

Read it, carefully, AGAIN.

Secure your database and follow the instructions... all of them!

You can then have every user who opens the database prompted for a
username and password (in fact they will HAVE to have a username and
password). You can customize each users' privileges to any form, any
table, any report; you can give some users read-only privileges,
others the right to update records, yet others the right to design or
change forms. And it's going to be much harder for unauthorized people
to get in than your very limited code example.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top