User Management with Tables

E

eraslan.cem

Hello;

I have searched for several topic but couldn't find any solution to a
problem and created my own one.

I have a database which users and their acess groups are define in a
seperate table. ( just because i have to give users different access
levels on the same forms but didn't find any solutions to a such
problem with the access' built-in user management module) I have
created a seperate module for my global variables, "UserName" and
"AccessGroup" which are defined globally. Foolishly, as the each user
logs in form the login fom, variables are changing. So it becames
impossible to define user's aceess levels. I am not an advanced
developer and don't want to change the login form and the user
definitions table structure.(not sure but if possible built-in user
management module can be used instead, any ideas in such a situation?)
So leave all them as is but as the users logs on there must be a
difference between them so that the tables understand their
"AccessGroup" and give them the appropriate rights.

I have thought of some ideas such as;

1) Access can create a simple txt file which defines the users
AccessGroup on the users computer and read the data from it as each
time the user tries to reach a table etc.
2) Defining Network ID's and IP numbers are another solutions but
-seems to me- each solutions would lead me to new problems.

Is there anyone who had faced such a problem or solve it in his own
way?

Any help greatly appreciated
 
A

Arvin Meyer [MVP]

You can set permission levels to objects with Access user-level security.
Have a look at the Security FAQ for specific information.

http://download.microsoft.com/download/access97/faq1/1/win98/en-us/secfaq.exe

You can also use the Windows login api to grab the Windows username and do
home-grown security.

http://www.mvps.org/access/api/api0008.htm

By building a hidden table, you can refer to the values and set permissions
on forms:

UserName FullName PermissionLevel
PW.Bill Bill Gerhan 5
PW.Brian Brian Murphy 3
PW.Bobby Bobby Ware 4

--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
A

Albert D. Kallal

I have
created a seperate module for my global variables, "UserName" and
"AccessGroup" which are defined globally. Foolishly, as the each user
logs in form the login fom, variables are changing.

No, the above is not how ms-access works.

If I fire up the calculator on my desktop, and start entering some values,
they do not effect the person
who is running the calculator on a different computer down the hall.

Computers have what is a called a CPU (central processing unit). When you
load and run
a program ON YOUR COMPUTER, then all values of variables are LOCAL TO your
computer that is running the software. So, if I set value of the global
date variable that
windows has, then other computers in the building don't magically change
their values.

The same concept apples to ms-access, and variables are kept separate on
each computer.

Of course data your store into a table can, and will be shared if your are
running more then
one user in the database, but the CPU is STILL ON EACH computer, and all
variables
are local to each computer.

however, you should as a general approach place the code and software you
run
on each computer. I explain this concept in "non" developer terms here:

http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm

So, even if you don't place the software on each computer, setting the value
of variable in code does not effect other computers in the office.....
 
E

eraslan.cem

All users are connecting to db via shortcut on their computers desktops
and the copy is running on the server.

This is the code related to this issue in the PublicVariables Module


******************************
Option Compare Database

' Public Variables

Public UserName As String
Public AccessGroup As String
******************************************

And this is the related code in the user login form's command button

********************************************************
'Variable Definion

UserName = Nz(DLookup("strEmpName", "tblUsers", "[lngEmpID]=" &
Me.cboEmployee.Value), 0)
UserPass = txtPassword.Value
AccessGroup = Nz(DLookup("strAccess", "tblUsers", "[lngEmpID]="
& Me.cboEmployee.Value), 0)
DoCmd.Close acForm, "frmLogon", acSaveNo
*************************************************************


Tried it with two user and put a msgbox()in the code to get the user
name value-in the server- but it returned different users. I will read
the article you sent me Arvin.

Thx for your advices and "basics of computer" lesson :)
 

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