I need to secure my database without having a login form.
I have about 50 users and need 3 types of access. read only, read/edit/add
new, and Admin/Full.
As the user opens the DB it checks the current user name against the tblUser
and allows access if the user exists in the table. I does not prompt for
login or password. If user does not exist, it displays msg to request DB
permissions from DB Admin.
Does anyone have the code for this? I am a bit lacking in the coding
department!!
Thanks in advance!!

Signature
deb
Douglas J. Steele - 03 Jul 2007 22:11 GMT
You do realize that that won't provide any security at all, I hope.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
>I need to secure my database without having a login form.
>
[quoted text clipped - 12 lines]
>
> Thanks in advance!!
Scott McDaniel - 03 Jul 2007 23:25 GMT
>I need to secure my database without having a login form.
>
[quoted text clipped - 8 lines]
>Does anyone have the code for this? I am a bit lacking in the coding
>department!!
As Doug said: This is absolutely NO security at all ... but ...
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "SELECT * FROM tblUsers WHERE strUserName='" & YourCurrentUser & "'", CurrentProject.Connection
If (rst.EOF and rst.BOF) Then
MsgBox "You don't have permission to open this database. Contact the Adminstrator for assistance", vbOkOnly
Application.Quit
End If
Anyone could still simply link to the database from another Access database, open tblUsers, and add themselves to the
table ...
>Thanks in advance!!
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
david@epsomdotcomdotau - 05 Jul 2007 13:45 GMT
The easiest place to get the current user from is the command
line. Create a short cut to msaccess.exe, something like this:
"c:\program files\...\msaccess.exe" "c:\my.mdb" /user=%user%
/wrkgrp="m:\my.mdw"
Add all the users to a workgroup file, using there login name,
the same as you see if you type
Set
at the dos prompt (open a command window).
Add three groups to the workgroup file, r, rw, af.
Add each of the new users to the appropriate group.
(david)
> I need to secure my database without having a login form.
>
[quoted text clipped - 10 lines]
>
> Thanks in advance!!