How to limit users in a database

webmeister

Definitely certifiable
Local time
Today, 14:25
Joined
Apr 6, 2006
Messages
107
I have a small database for doing some tracking and some reporting. I want to be able to allow everyone to view the data and also to print reports. However, I also need to limit who is able to enter data into this application.

I don't want to build a login form for the application...I want to be able to limit users based on their Windows Login name, which I would have in a table. The first thing I would do is compare their Windows login name against the table, and then put in code such as "If table name = suchandsuch then you can't do suchandsuch, but if tablename = blahblah then you can do something."

Is something like this doable? If so, how might I go about getting started with this train of thought?

Thanks to any and all who respond..... I appreciate your time and knowledge!!
 
You can use the environ("Username") to retrieve the windows log on ID. Do you have your database setup as a FE/BE?
 
you will be reinventing the wheel a bit. The easiest way to do this is to look at intrinsic Access security, and use that.

In your system, although you might stop users opening forms, you won't easily stop them opening the database window, and from there they can see everything anyway.

If they are good enough they can write their own queries, or even create a new database, and copy everything you have in your database.

There are loads of issues about security, so have a look at the threads here.
 
KeithG, thanks for replying.... it's going to end up as a FE/BE. Right now, it's all mushed together.

gemma-the-husky, thanks for your reply also. I agree with all you said, but even if I was to use Access' "intrinsic security,", people could still figure ways around that. I guess it's like the old saying, that if you build a super lock, someone will develop a super key. And I have built other applications with login forms, password encryption, data masking, etc., etc.

In this case, the application is relatively simple, with no really secure data... all I want is something that on the surface will allow only a few folk to enter data, while everyone else can look at the data either online or from reports that they choose to view or print. We're just trying to limit the number of people who can enter data. The data obviously is not sensitive.

In any case, thanks for responding..... I appreciate it!
 
What I would strongly recommend is what we use here at my work. Although it is not what you want probably.

We do use a login script, to check if it is a firstime user or if they have used it before, all information is posted in table 'Users' in this table it contains their Environ("UserName"), LastLogin, Computer Name, and Rights Level.

I have it where it sets at the default level - 10, then 50 is for supervisors and 100 is for the admin side (IT). From this table I can do a dlookup on the form_load and then be able to set whatever restrictions I want for the forms/menu's or whatever.
 
Cross5900,

Thanks for replying..... could you possibly send me a copy of your application (minus, of course, any sensitive data)?? I'd love to see what you've developed. It might be something I can adapt!!:)

If you can't send it, I understand also. Thank you!!
 
You could retrieve the username with the environ function and then write code to link the approriate tables for the given username.
 
KeithG,

Absolutely, and thanks for the suggestion! I really appreciate the folks in this forum who give advice and help so freely!
 

Users who are viewing this thread

Back
Top Bottom