Re: Log In

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Sat, 25 Oct 2008 00:24:01 -0700, Denver
<Denver@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I can't guarantee that. However you're free to post back to the
newsgroup at any time.
I'm going to present a simple solution. Not the most secure or the
most features. Simple.

First thing we need is to find out who is using the app. Just ask
Windows who is logged in. See
http://www.mvps.org/access/api/api0008.htm for the code. Put this in a
standard module.

Next you need a table (say tblSecurity) with UserName (make this the
Primary key) and a bunch of Yes/No permission fields. If this were the
Northwind sample application I might have fields like IsAdministrator,
CanEnterOrders, CanViewOrders, etc.

Last is to write some one-liners in various places to check the
permissions. For example in the Orders form's Form_Open I would write:
if dlookup("CanViewOrders", "tblSecurity", "UserName='" &
fOSUserName() & "'") = False then Cancel = True
(note how the username is wrapped in single-quotes)
With this line I am checking if the CanViewOrders YesNo field in the
security table is set to False, and if it is, I set Cancel=True which
conveniently stops the opening of that form.
Why don't I write this code in the menu option or button click that
opens the form? Because there may be several ways to open the form and
I would have to be very careful not to forget any. The way I did it I
would have to write code only in one location.

To give someone readonly access I would set the form's AllowEdits
property to False:
(also in the Form_Open)
if dlookup("CanEditOrders", "tblSecurity", "UserName="" &
fOSUserName() & "'") = False then Me.AllowEdits=True

-Tom.



Hello Tom van Stiphout,
thanks for your reply...

First thing is that i am not a programmer, new to access and don't have
knowledge about security for database.

2nd thing as you qouted,

"But there are other, simpler solutions. Just tell us what you want to
do. How are you going to use the knowledge about who logged in? How
secure do you need it to be?

**yes i just want the simpler solution. I want to set user account and
permission like Read Only and similar. what would be my first step in
accomplishing it? this is the thing i want to accomplish for now. iam hoping
Tom that you will be patience to guide until i have my last step in
accomplishing it.

thanks

********************************************************
"Tom van Stiphout" wrote:

On Thu, 23 Oct 2008 23:22:04 -0700, Denver
<Denver@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Your first statement doesn't make any sense. You *should* be deploying
..mde files for production, and keep the mdb file for yourself for
further development.

You should also split the db in front-end and back-end. Use a tool
like Tony Toews auto-updater
(http://www.granite.ab.ca/access/autofe.htm) to keep all users on the
latest version of the FE.

What are you trying to accomplish with user accounts? Note that
user-level security is an advanced topic and you should not use it
until you download, study, and fully understand the Microsoft Security
FAQ.
But there are other, simpler solutions. Just tell us what you want to
do. How are you going to use the knowledge about who logged in? How
secure do you need it to be?

-Tom.
Microsoft Access MVP


hi,

I have my database i want to share to some of my colleagues for updating.
i dont want to convert it to MDE because it is not finalize yet but is
usable now.
i want to share my database to some of this users and i want to create
users account.

what would be my first step to this? can anyone guide me or give me some
advice or link for any notes that i can read from.

thanks..

.



Relevant Pages

  • Re: Log In
    ... knowledge about security for database. ... I want to set user account and ... accomplishing it? ... I have my database i want to share to some of my colleagues for updating. ...
    (microsoft.public.access.security)
  • Re: Log In
    ... R_W - read and write permission but cannot delete or modfiy existing reocrds ... knowledge about security for database. ... accomplishing it? ...
    (microsoft.public.access.security)
  • Re: secured db, yet insecure with alternate worgroup file..
    ... Did you check ownership of the "Database" object? ... left as "Admin" by people setting up security who don't know what they're doing. ... If a user account "owns" the database then they can open the file regardless of ...
    (microsoft.public.access.security)
  • Re: linksys media center extender installation error
    ... Is the user account that you're running on the PC a member of the ... Clear all events from the system, security, and application event viewer ... 1:13:28 PM: Verifying Privacy Policy is present. ... 1:13:51 PM: Verifying MCRD users group exists. ...
    (microsoft.public.windows.mediacenter)
  • [Full-Disclosure] RE: [Full-Disclosure]MS should re-write code with security in mind. lame bitching
    ... Earlier versions of NT had security in mind (perhaps a ... IIS 3.0) ran under a user account. ... The biggest boon to security would be to start simplifying Windows. ... But since Joe No-pun-intended Shmoe at home doesn't want security, ...
    (Full-Disclosure)