Network Login Name/ "Home rown security"

C

cmraguilar

So from what I've read, you can't tie in Windows Log In names to security
settings in Access. So i've come up with an idea that I would like to throw
out there. First off, the DB will be split (FE/BE) for real time updating
purposes and multiple users. Keeping in mind the BE will be on a secured
network drive, but available to everyone. Second, I want to get away from
using passwords because of the numerous apps we use.

What I came up with is to use API "GetUserName" as an indicator to set up
the .visible/enable settings on the forms. There may be no more than 10
users who alter some of the data, and the rest would be as a "read-only."
So my questions is when setting up the IF statements for the .visible/enable
settings, should I use a long IF statement or try to group them before
hitting the IF statement.

OR
Is this idea not so good and should I go another route with setting this up?

Thanks ahead and I appreciate feedback.
 
B

ben

What you want to do is just how I set up access to my DB for my coworkers.

Make a table with everyones network login name that should have access to
the database. I also add, first name, last name, and an level of access to
the table.
Example

firstname | lastname | username | lvlofaccess |
John | Smith | jdsmith | one |
Tim | Johnson | tjohnson | two |

Now make your api function to set get the username off the computer opening
the database in a hidden forum that opens on start up.

set up global variables for username and member name like
gblusername = rs.fields(3)
gblmembername = rs.fields0) & "" & rs.fields1)
gblacceslvl = rs.fields(4)
Then use and if statement to check if the person opening the database has
access

Dim rs As Recordset
Dim gblMemberName As String

Set rs = CurrentDb().OpenRecordset("SELECT tblMembers.*, tblMarket.Market
FROM tblMembers " & _
"INNER JOIN tblMarket ON tblMembers.MarketID = tblMarket.MarketID WHERE
tblMembers.UserName " & _
"LIKE '*" & gblUserName & "*'")

If rs.EOF = True Then
MsgBox ("Your username was not found in the Managed Queue database." &
vbCrLf & _
"Please contact Ben Ferderer to be added."), vbOKOnly
DoCmd.Quit
Else
gblMemberToID = rs.Fields(0)
gblMemberTo = rs.Fields(2) & " " & rs.Fields(1)
gblMemberName = rs.Fields!UserName
gblAccesslvl = rs.Fields(4)
End If

Then you can use if statements on level of access to open the correct forum
or use the visible like you posted about.

If gblAccesslvl = "two" then
DoCmd.OpenForm "frmABC", acNormal
Else

DoCmd.OpenForm "frmXYZ", acNormal
End If

----and -----
If gblAccesslvl = "two" then
Me.ABCbutton.Visible = True
Else
Me.ABCbutton.Visible = False
End If


If you need help with the api function to get the username just reply and I
will help
 

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