?Second post?? - Customizing Security

T

Tammy

I thought I had posted this question before, but cannot
find it! So, here it goes. I have secured my database,
and set one menu to be used only by a specific group of
users. However, when a user tries to access it and gets
the message that he/she doesn't have access, the user
gets "kicked out" - I would like to just return that
person to the main menu and give them a more friendly
message. How do I do this?? Also, any good books for
reading up & learning about security?? As someone else
posted, this is a BIG topic, and I would like to learn
the "big picture" versus doing this piece by piece!

I am planning to put this on the system by the end of the
week - of course, it will need tweeked! I will set
up/keep security as is for now. But, if possible, I
would like to have the security working in a user
friendly manner!

THANKS, in advance!
 
T

TC

I thought I had posted this question before, but cannot
find it! So, here it goes. I have secured my database,
and set one menu to be used only by a specific group of
users.

How did you do that?

However, when a user tries to access it and gets
the message that he/she doesn't have access, the user
gets "kicked out" - I would like to just return that
person to the main menu and give them a more friendly
message.

What was the message?

How do I do this??

I'm sure we can tell you; just give us more info.

Also, any good books for
reading up & learning about security?? As someone else
posted, this is a BIG topic, and I would like to learn
the "big picture" versus doing this piece by piece!

Commendable :) The Access Security FAQ is often recommended. You'll find
links to it throughout this newsgroup. Also, many of the regular posters
have a personal website with more information - see the signature lines of
their posts.

Personally, as part of the learning process, I recommend that you draw some
diagrams. Draw a box for each of several MDWs, and another for each of
several MDBs. Find out which box(es) contain: usernames, passwords, group
names, user/group relationships, objects (eg. tables), and object
permissions (eg. >where is it stored< that user Tom has Insert access to
table X?). This will put you well on the way to understanding it better.

I am planning to put this on the system by the end of the
week

Er, today is Wednesday, no? :)

HTH,
TC
 
T

TC

Ok, I understand. You have used Access security options to prevent certain
users from being able to access certain forms. When they *try*, they get a
default message like: "you do not have priviliges to open this form". You
want something nicer/better. Here are two alternatives.

(1) Disable the main-menu button for that form, if the current user is not
allowed to run it. To do that, you would put code in the Open or Load event
of the main-menu form. That code would set the Enabled property of the
button to True (if the current user was allowed to run that form), or False
(if not).

(2) Alternatively, leave that button enabled always, but in its Click event,
check to see if the current user is allowed to run that form. If not,
display a message, then just don't try to open the form.

Both of the above suggestions, need code that answers the question, "Does
the current user have permission to run form BLAH?". Here is that (untested)
code:

dim bCanRun as boolean
with dbengine(0)(0).containers![forms].documents("BLAH")
.username = currentuser() ' probably not required.
bCanRun = ((.allpermissions and acSecFrmRptExecute) = acSecFrmRptExecute)
end with
if bCanRun then
' user can run the form.
else
' user CAN NOT run the form.
endif

HTH,
TC
 
T

Tammy

-----Original Message-----



How did you do that? **Well, I did that by setting
the "User Permissions" in the Access security menu -
where you select the form and then give the user/group
priveleges to open or not open. Hope that was clear
enough! I have a hard time explaining these things!**

What was the message? **I don't have the message
verbatim as I have actually "taken off" the security
(created a new db) for now. I have to load the db to the
server at the end of the week, and had some problems
before when I tried to transfer the actual database and
mdw file. I thought this time I would wait until I put
it on for use (the first time was for demonstration
purposes)! But, the message was something to the effect
of "you do not have priveleges to open this form" - that
was the "idea" - I don't know if that's at all helpful!**
I'm sure we can tell you; just give us more info.
**Hope this was a little more helpful! While I am
waiting to check for updates to this post, I will see if
I have an old version where I can see the actual
message! As you can probably tell, I haven't really used
security before, and am relatively new to VBA/Access
anyway! So, that's why I am hoping to find a book.
Seems like when I do a search, I don't usually find what
I need. I guess I don't know what key words to look
for. I checked for this, but didn't come up with
anything! As for the charts, I will try to do that
(although, I am not sure I fully understand even all of
that! - scares me!), but I have only this one database
that has been secured so far and I am working
independently, so not all the MDWs will be "related".
THANKS AGAIN!**
Commendable :) The Access Security FAQ is often recommended. You'll find
links to it throughout this newsgroup. Also, many of the regular posters
have a personal website with more information - see the signature lines of
their posts.

Personally, as part of the learning process, I recommend that you draw some
diagrams. Draw a box for each of several MDWs, and another for each of
several MDBs. Find out which box(es) contain: usernames, passwords, group
names, user/group relationships, objects (eg. tables), and object
permissions (eg. >where is it stored< that user Tom has Insert access to
table X?). This will put you well on the way to understanding it better.



Er, today is Wednesday, no? :)
** Uh, yeah... scares me! I will have some type of
security set up. For this one, I may HAVE to do it piece
by piece - I didn't realize what all was involved when I
started it!**
 
T

Tammy

Yes!!! Thank you so much! I will work with what you have
given me! (Although, I may have more questions!)
-----Original Message-----
Ok, I understand. You have used Access security options to prevent certain
users from being able to access certain forms. When they *try*, they get a
default message like: "you do not have priviliges to open this form". You
want something nicer/better. Here are two alternatives.

(1) Disable the main-menu button for that form, if the current user is not
allowed to run it. To do that, you would put code in the Open or Load event
of the main-menu form. That code would set the Enabled property of the
button to True (if the current user was allowed to run that form), or False
(if not).

(2) Alternatively, leave that button enabled always, but in its Click event,
check to see if the current user is allowed to run that form. If not,
display a message, then just don't try to open the form.

Both of the above suggestions, need code that answers the question, "Does
the current user have permission to run form BLAH?". Here is that (untested)
code:

dim bCanRun as boolean
with dbengine(0)(0).containers![forms].documents("BLAH")
.username = currentuser() ' probably not required.
bCanRun = ((.allpermissions and acSecFrmRptExecute) = acSecFrmRptExecute)
end with
if bCanRun then
' user can run the form.
else
' user CAN NOT run the form.
endif

HTH,
TC


the "User Permissions" in the Access security menu -
where you select the form and then give the user/group
priveleges to open or not open. Hope that was clear
enough! I have a hard time explaining these things!**


verbatim as I have actually "taken off" the security
(created a new db) for now. I have to load the db to the
server at the end of the week, and had some problems
before when I tried to transfer the actual database and
mdw file. I thought this time I would wait until I put
it on for use (the first time was for demonstration
purposes)! But, the message was something to the effect
of "you do not have priveleges to open this form" - that
was the "idea" - I don't know if that's at all helpful! **
**Hope this was a little more helpful! While I am
waiting to check for updates to this post, I will see if
I have an old version where I can see the actual
message! As you can probably tell, I haven't really used
security before, and am relatively new to VBA/Access
anyway! So, that's why I am hoping to find a book.
Seems like when I do a search, I don't usually find what
I need. I guess I don't know what key words to look
for. I checked for this, but didn't come up with
anything! As for the charts, I will try to do that
(although, I am not sure I fully understand even all of
that! - scares me!), but I have only this one database
that has been secured so far and I am working
independently, so not all the MDWs will be "related".
THANKS AGAIN!** the
regular posters the
signature lines of recommend
that you draw some usernames,
passwords, group has
Insert access to of
the
** Uh, yeah... scares me! I will have some type of
security set up. For this one, I may HAVE to do it piece
by piece - I didn't realize what all was involved when I
started it!**


.
 
J

Joan Wild

**Well, I did that by setting
the "User Permissions" in the Access security menu -
where you select the form and then give the user/group
priveleges to open or not open. Hope that was clear
enough! I have a hard time explaining these things!**

I strongly suggest you download and study the security FAQ. Just setting
permissions in the menu is only one piece of the puzzle. You need to create
a new mdw first.
 
T

Tammy

Thanks, yes, I do plan to do that! I am just trying to
get information & start planning so that I can create the
MDW on the server where the file will be in use. If you
have comments towards that, I'm open! However, I will be
the first to admit that I am in need of any/all
information! When you say that I should "download the
security FAQ" - I guess... do you do this as a whole??
Please forgive my ignorance! I would really like to get
a recomendation on a good book out there, as the book
will last much longer with me!! Not that I am against
printing the FAQ! I will "give it a go" - but I am
relatively new to Access and VBA and really BRAND new to
the security aspect! I am not totally familiar with
terms, etc. So, I don't always get the full
understanding of "pieces" of information. Thanks for all
your help (everyone!)!!
 
J

Joan Wild

Hi Tammy,

It is important that you do some reading before you attempt security.

Download the FAQ (it's a Word document) from
http://support.microsoft.com/?id=207793

It contains a step by step procedure to secure a database. It's important
that you follow every step (every phrase even), in order.

You could also read the Security Whitepaper
http://support.microsoft.com/?id=148555

Although the whitepaper is old, it contains information to help you
understand security.

Other good reads
Lynn Trapp's
http://www.ltcomputerdesigns.com/Security.htm

Jack MacDonald's
www.geocities.com/jacksonmacd

Post back with any bumps you hit.
 

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