Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem disabling the Shift F11 keys

Status
Not open for further replies.

Matf

Programmer
Aug 28, 2003
23
0
0
US
Hi, I have a little problem disabling the Shift F11 keys on startup. I have followed the directions and created the property AllowBypassKey and have subsequently set it up to False. That works in not letting me see the database, menus ant toolbars when I open.

However, if I hold the Shift F11 keys when I open the Database I can go into the Tools/Startup and change the options. Then I just close and open the database and everything is available. I can change the startup as long as I am holding Shift F11.

Am I doing something wrong?
Is there a way to stop this from happening?

Thanks
 
The AllowBypassKey property itself doesn't affect whether the database window, menus, or toolbars are visible. It only affects whether holding down the Shift key (not necessarily with F11) causes Access to ignore the other startup properties.

If it isn't working, you must have set the property up wrong. What code did you use to create and set AllowBypassKey?


Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I used:
Set prp = CurrentDb.CreateProperty("AllowBypassKey", 1, False)
CurrentDb.Properties.Append prp
and then
CurrentDb.Properties("AllowBypassKey") = False

as I say it does block the user from presing SHIFT F11 and seeing the main database window. the problem is that while I'm holding the SHIFT F11 keys I can see the toolbar and go into tools and change the startup options. When I release the shift F11 keys the toolbar disappears. but if I shut down and restart the changes I made while pressing shift f11 take effect.
 
Matf,

I think you're mixing up 2 different database functions.

1. Entering a database with the shift key.
2. Pressing F11.

The first one is basically opening a database while holding down the shift key. This will bypass the start up options and go straight to the database window. The AllowBypassKey property that you've set prevents this.

The second option is the ability to hit F11 from anywhere in the database. This also brings up the database window and the AllowBypassKey property has nothing to do with this. However there is another database property called AllowSpecialKeys which does prevent the use of the F11 key. Just append this and set it to false the same way you set the first one and it will stop F11 hitters.

However, while we're on the subject, if your objective is to prevent your users from messing around with your database design then those 2 options aren't enough to keep out creative users. I've written 2 FAQs on the subject. See FAQ181-1021 for more info.

Maq [americanflag]
<insert witty signature here>
 
Maquis, Thanks for the info. However, my problem is a little different. I don't know if I have just found a new way to override security or what. But I can still change the startup properties of my database.

This is what I did:
First I disabled all the options in tools/startup
Then I used the code explained above to disable the shift key option.
So I closed my databse and when I tried to open it again holding the shift key it did not allow me to see the database screen. All good up to here.

The next thing I tried was openning the database holding the shift and F11 keys at the same time (I don't know why I did that)
While I'm holding these two keys I have access to the menu of my application. If I let go any of these two keys the menu disapears.
So while holding the 2 keys I can go into the menu tools/startup and recheck all the options in the startup.
When I let go the shift F11 keys the menu disappears and everything looks OK.
Now when I close the database and reopen it all the changes I did to the startup while holding the two key take effect and the user can see absolutly everything.
Did I find a way around diabling the Shift key? or I'm just dumb and cannot disable the shift key correctly?

At this point I leaning towards the second option

I'll appreciate any help
 
I really think all you have to do is disable the F11 key, like I explained earlier.

I just tried to &quot;break into&quot; one of my databases that I have locked down and neither F11 nor shift-F11 bring up any menus.

You said you unchecked everything in the start up menu. Did you also uncheck the 2 hidden options in the drop down?? That's where the F11 functionality is. Just click the &quot;advanced&quot; button in the startup menu to display them.

Maq [americanflag]
<insert witty signature here>
 
Yes I unchecked the hidden options (I only have one)
Maquis can you try something?
Hold the shift key and double click on an access database that you have secured. Do not release the shift key. When it has finished loading (still do not release the shift key) look at the menus on top when I do that I have the regular tool bar.
While holding still the shift button go into the tools/start up and change the options.

I have access 2000 and my database have been split I don't know if that matters)

If it does not happen to you then I will be satisfied that I am just dumb and have to reread for the 10th time the instructions

Thanks
 
I've already done that. I have the shift key disabled in my databases, so it doesn't matter whether I hold it down or not. It just won't work.

When I launch one of my locked databases, I don't get full menus (This is because I have unchecked the &quot;Allow Full Menus&quot; option in the startup menu) so I cannot get to the Startup options. I still have the standard menus, but most of the dangerous functionality has been stripped off of them.

I'm currently using Access 97, but I believe that these options are still true for Access 2000. If anyone knows differently, please chime in here.

You said you have a split database. Are both databases locked down? Perhaps thats the problem.

Did you read the FAQs I mentioned above. This is the code that I use in my databases and it works fine. However the code will definitely need to be tweaked a bit for Access 2000. Microsoft went from DAO connection terminology to ADO with that release.

Maq [americanflag]
<insert witty signature here>
 
I believe you may have discovered a &quot;back door&quot;, and I believe that this may well be something different between Access 97 and Access 2000. I can't experiment with it right now, but I will when I get home.

Maq, your code won't necessarily have to be tweaked for Access 2000. DAO is still available in .mdb databases, it's just not the default. All you should have to do is add a reference to the DAO library.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Maquis,
Thanks for all your help after trying all kind of things I found something that works.
I created a custom menu bar and assigned it instead of the default in the startup screen.
Now when I open the database holding the Shift key it still shows me the full menu bar but it does not allow me to click on anything which is as good as it gets. when I release the shift key it shows the menu bar I created.

This solved my problem now I just need to find a way to secure the database so nobody can look or change the data directly with out going throught the forms.

Do you have any idean on that? (remeber my database has been split).

Thanks
Matf

 
I'm glad you found something that works for you.

Rick, please post back after you have a chance to try Matt's trick in Access 2000. You've got me curious now.

As far as preventing users from looking or updating your data, you'll have to implement Access security for that. I can't advise you much there, since I've never used Access security myself. I've always been more interested in protecting the database design rather than the data. Our users own the data and they're responsible if someone goes in and messes it up. I'm only responsible if they destroy the forms.

However, with sensitive and confidental data, that isn't a good answer. Search the Tek-Tips forums for threads dealing with Security. There are entire books on the subject within these threads. [reading] It's not for the timid. You can really screw up a database if you don't know what you're doing, but I've been told that it can also be a really useful tool once you learn how to properly implement it.

Just don't ask me, I'm still too timid. [worm]

Maq [americanflag]
<insert witty signature here>
 
I can now verify what Matf has said. He's discovered a backdoor bug in Access 2000.

I had noticed this behavior before, though not in the context of AllowBypassKey=False. It never dawned on me to test whether the menu bar actually works. It shocks me that it does. I assumed Access was just in a loop waiting for the Shift key to be released before it processed the startup properties.

I couldn't get it to work at first. Apparently, if you open the file itself (by double-clicking) and if no Logon prompt appears, it doesn't work. If you open Access first, then hold down Shift while you select the file either from the startup dialog or from the File menu, the full menus are available. Or, if the Logon prompt appears because the Admin user has a non-blank password, the menus are available. (Note: It is not necessary to hold down F11 with Shift. Shift alone will do it.)

Most distressingly, I fully secured and encrypted a database and converted it to an MDE, with all the Startup properties disabled and it still allowed me to get into the VB Editor by holding down Shift. This is a serious hole in Access User-level Security!

Matf, you should consider reporting this as a bug.


Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Wow! [surprise]

Thanks for the research Rick!

Matf, I'm sorry for doubting you. I've never seen this behavior before. I've since tried a few more times to duplicate it in Access 97, and I can't. Remind me never to upgrade!

Maq [americanflag]
<insert witty signature here>
 
Disabling the f11 key in access 2000. How would I be able to get in the back door if I diabled the f11 key? Thanks all.
 
Hi,

I don’t know if there has been any update on this presumed bug (if so it is probably a MsFeature...), but I do have trouble reproducing in certain cases. If I have disabled all the menus on my db (and use customised menus) I can definitely not access any menu. There is no right clicking possible either.

Can anyone from this thread acknowledge that it is a bug indeed or that it can be eliminated ?

Maarten
 
easyit,

I reported to Microsoft the menus issue as a bug and never heard back so I would not count on them doing anything to fix it.

However you are right on creating your own custom menus. I have tried to break into my database after setting up custom menus and have not been able to so I guess as far as I know it is secured.
 
...like I said, a MsFeature...

Thanks for confirming my findings!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top