User Access

D

DavisGail

I have a question regarding user security in an Access 2003 database. I have
created a task assignment database in Access 2003. Is there a way to allow
users to only see the tasks that they (the user) were assigned or assigned
themselves? I'm not an expert on security, but I know it can be tricky. Any
help is greatly appreciated.
 
T

Tom van Stiphout

On Tue, 31 Mar 2009 05:30:01 -0700, DavisGail

You do not need workgroup security for that. You just need to know who
is logged in (e.g. http://www.mvps.org/access/api/api0008.htm) and
store this value in a global variable (say g_strUserName). Then
provide a public function to return that variable:
(in a standard module:)
public function GetUserName() as string
GetUserName = g_strUserName
end function
Then call this function in your query:
select * from tblTasks
where UserName = GetUserName()

-Tom.
Microsoft Access MVP
 
R

Ron2006

This is a valid method to limit the records viewed.

There are implications however.

If John Doe is on vacation, and someone is their backup and supposed
to do their work/view their records then, if you are using this
method, the backup will HAVE to login to the network as that person in
order to view those records.

You will need to logically handle this in your overall application
design.

Ron
 
A

a a r o n _ k e m p f

SQL Server supports the EXCUTE AS statement.. where you can run code
as someone else (if you have permissions)
 
T

Tony Toews [MVP]

DavisGail said:
I have a question regarding user security in an Access 2003 database. I have
created a task assignment database in Access 2003. Is there a way to allow
users to only see the tasks that they (the user) were assigned or assigned
themselves? I'm not an expert on security, but I know it can be tricky. Any
help is greatly appreciated.

Please ignore Aaron Kempf's posting as Aaron's answer to just about
every question is SQL Server and ADPs. No matter how appropriate his
response.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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