Creating internal Users & Password - Logging

I

ILIR ISTREFI

I would be grateful if anyone can help me with this code.

1. I have created Table USERS with these fields: No.(autonumber),
USER(text), Password(text)***.
2. Then have I created Form named LOGIN which looks something like the
drawing bellow (2 fields for entering Username & Password + Login button).
This form has no source table at all.


----------------------------------------------
Please enter Username and Password


User:____________ ________
+ +
+LOG IN +
Password:________ +_______+
----------------------------------------------

3. On this database I made Macro named Quit which Quits the Database and I
have created a Switchboard as well.

-What I need now is a code for the Log IN button that would check if
appropriate fields from LOGIN Form match with ones on table USERS, If YES
then open Switchboard, if No then run Quit Macro.

P.s. I Dont want to use MS Access User Accounts because on the computer
which my database is running there are few other databases randomly accessed
by other users.
 
R

Rick B

Your concern has nothing to do with Access User-level security. You can
secure ONLY one database and allow other databases to be opeined withou a
userid and password.

Follow the steps to properly secure your database and create a shortcut so
it uses the appropriate secured workgroup file. LEave the users joined to
the default workgroup so other databases can be opeoned withou a login.

Any home-grown security you create will be very easily defeated by evven a
moderate Access user.
 
R

Rick Brandt

ILIR said:
I would be grateful if anyone can help me with this code.

1. I have created Table USERS with these fields: No.(autonumber),
USER(text), Password(text)***.
2. Then have I created Form named LOGIN which looks something like the
drawing bellow (2 fields for entering Username & Password + Login
button). This form has no source table at all.


----------------------------------------------
Please enter Username and Password


User:____________ ________
+ +
+LOG IN +
Password:________ +_______+
----------------------------------------------

3. On this database I made Macro named Quit which Quits the Database
and I have created a Switchboard as well.

-What I need now is a code for the Log IN button that would check if
appropriate fields from LOGIN Form match with ones on table USERS, If
YES then open Switchboard, if No then run Quit Macro.

If DCount("*", "USERS", "USER = '" & Me.User & "' AND Password = '" &
Me.Password & "'") > 0 Then
'user/password found
Else
'user/password not found
End If
P.s. I Dont want to use MS Access User Accounts because on the
computer which my database is running there are few other databases
randomly accessed by other users.

You can use Access built in security on only one file without affecting any
other file. You would just use a shortcut that specifies the secured
workgroup instead of the default one. What your doing above would take 30
seconds to get around by anyone who has a smattering of Access knowledge.

You do know for example that anyone could import or link to the USERS table
from another file right? They can also hold the shift key to open your file
without going through your login form (or press F11 to get to the db window
or Ctl-G to get to the immediate window, etc.).
 
I

Ian Davies

Rick

On the subject of holding the shift key down. Microsofts website says that
by putting the following in the immediate window

CurrentProject.Properties.Add "AllowBypassKey", False
http://support.microsoft.com/default.aspx?scid=kb;en-us;826765
You can disable the functionality of the shift key.

Ive just tried this, out of interest but it doesnt appear to work.
Which is a shame as the OP would have needed something like that
Ian
 
D

Douglas J. Steele

The AllowBypassKey does work.

When you tried it, did you shut down the database before you tried it?
 
I

Ian Davies

Yes, I followed their (MS) instructions to the letter,
I shut down the DB and also Access
but it still didnt work. I can even get into an MDE version.
Might it be because I have 2 versions of Acccess installed?

Ian
 
D

Douglas J Steele

Multiple versions of Access shouldn't matter.

To be honest, I've never tried using the specific approach outlined in the
KB article. Instead, I use DAO, as outlined at "The Access Web"
http://www.mvps.org/access/ (Sorry, my web access isn't working at the
moment, so I can't give you an exact link. Do a search on AllowBypassKey)
 

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

Similar Threads

Click on website button with tag "button" 0
Users 3
Login page 3
reset password 4
sending data from my text box to my table 5
tables 1
INSERT Multiple strings in Table 1
Controlling another switchboard 2

Top