User Level Security

G

Guest

I had set up a user level security with a couple of admins and a few users. I
did this setup on my system, the database is on the shared network drive.
When I opened the application in my system, it prompted and recorded the
Current User and passwords accurately. However, when I opened it from any
other system, it opened directly without prompting for a User Login. I am
assuming this is because the System .mdw file was created in my C drive.
Could anyone tell me how do I set the security up such that the workgroup
information is for everyone who accesses this database from the shared
network drive.

Thanks for any suggestions.
 
G

Guest

Was this Access 2003 or 97? If it's 2003 just use the wizard. It actually
works quite well and does most of the work for you. Just place the database
where you need it and start the wizard.

If it's 97 see Access 97 Developer's Handbook pg 311
 
K

Keith W

MS learner said:
I had set up a user level security with a couple of admins and a few users.
I
did this setup on my system, the database is on the shared network drive.
When I opened the application in my system, it prompted and recorded the
Current User and passwords accurately. However, when I opened it from any
other system, it opened directly without prompting for a User Login. I am
assuming this is because the System .mdw file was created in my C drive.
Could anyone tell me how do I set the security up such that the workgroup
information is for everyone who accesses this database from the shared
network drive.

Thanks for any suggestions.
You should *not* be changing the default "system.mdw" but creating your own
workgroup information file (WIF), eg "secure.mdw". The WIF should be stored
on a server where all your users can see it and they would join it on a
session-by-session basis using the "/wrkgrp" switch in a shortcut command
line. However, if users can still open your app from a browser without
entering logon details then you have missed at least one step in securing
the app.

Essential reading before attempting to secure an Access file is the MS FAQ
on the subject. There's a link to it on my website along with my
step-by-step example. Be sure you read and understand the FAQ before you
try to secure your app - experiment on dummy files first.

Good luck.
Keith.
www.keithwilby.com
 
G

Guest

Thank you for the link. I did realize that I should not be setting up a
system.mdw because when I did that even other Access applications had to be
opened with the user name and passwords in the mdw file.

I have put this database on the server and I had split it after that. Now
does it matter where I run the User Level Security wizard from (the server or
my own system?). Moreover, the purpose of having this user sign in is just
for merely tracking the user inputs in case of a question regarding the data
entered. So it does not have to be a very tight security.

I was not too clear about the "they would join it on a
session-by-session basis using the "/wrkgrp" switch in a shortcut command
line. ". Please could you further help me out with that?


Also, this is Access 2000.

Thanks once again.
 
G

Guest

If you are strictly looking for the user entering data and not security, an
easier method might be this -
(put this code in a module)
***

Private S1 As String
Private Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA"
(ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As
Long

Public Function FindUserName() As String
' Function that returns the name of the currently logged on user
' Example - MyString = FindUserName
S1 = Space(512)
GetUserName S1, Len(S1)
FindUserName = Trim$(S1)
FindUserName = Left(FindUserName, Len(FindUserName) - 1)

End Function

****

I received this code from a newsgroup years ago. Don't know who posted it.
They never signed it. Hope this helps you out.
 
G

Guest

Will this be pulling the user name from the network login? Could you tell me
how this would be working? Thank you very much for your patience and help.
 
G

Guest

Yes this will pull the network login. Now that you mention it I was assuming
that the users would be logging into a network and that it was not a shared
pc. If my assumptions were incorrect then the code won't work in this
situation and my appoligies. But if my assumptions were correct then the
code below would work well. Also you won't have to support a security file
and it will be ready to go for anyone logged in.

Hope this helps.
 
G

Guest

Thank you very much for the code. I tried the code but an error appears
stating that the method GetUserName S1, Len(S1) has not been defined.
I really appreciate all your help and yes we do have a network login and I
think that would be perfect instead of having an access security.
 
G

Guest

It works well now. Thank you very much. I am really relieved to get this
small but important issue out of the way. Once again, thanks.
 
G

Guest

Glad that it works.


MS learner said:
It works well now. Thank you very much. I am really relieved to get this
small but important issue out of the way. Once again, thanks.
 

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