Attached is a sample db that will let you have better control over the ByPass (Shift) key. It will help you keep the Riff Raff out.
Special thanks to Jim Bulger for sharing this at another Access forum.
Enjoy!
Tom
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Disable the ByPass key (97)
Hello Tom,
In some circumstances it is nice (from the viewpoint of the programmer) to disable the Shift key as a bypass. In that case, the code in your sample is very handy.
But remember that it is *not* a substitute for Access security. If you don’t secure the database, people (“riff raff”) will still be able to import database objects (tables, …) into another Access database.
Regards,
Hans
Hans,
A question for you. Other then the normal access security, are there any other ways to prevent users from importing the database objects to another database?
I have saved a database as a .mde and put on a top level database password. I am not using access security to create named users / groups. The below code is also used to lock up the database during use.
Without using security for groups and users, do you know of any ways that would prevent tables and queries from being imported to another database?
Sub SetStartupPropertiesNone()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
‘ChangeProperty “StartupForm”, DB_Text, “Customers”
ChangeProperty “StartupShowDBWindow”, DB_Boolean, False
ChangeProperty “StartupShowStatusBar”, DB_Boolean, False
ChangeProperty “AllowBuiltinToolbars”, DB_Boolean, False
ChangeProperty “AllowFullMenus”, DB_Boolean, False
ChangeProperty “AllowBreakIntoCode”, DB_Boolean, False
ChangeProperty “AllowSpecialKeys”, DB_Boolean, False
ChangeProperty “AllowBypassKey”, DB_Boolean, False
MsgBox “Design Access Disabled”
End Sub
I’m not an expert in Access security, so I hope others will jump in.
If you have set a database level password, anyone wanting to import tables/queries from the database would need the password. But I gather that this password is not all that hard to crack; there are password cracking services.
Making a .MDE means that forms, reports and modules are secured.
The other measures you describe (disable bypass key etc.) have no bearing on importing tables/queries; they lock the interface as much as possible.
Regards,
Hans
There are other ways to do this as well if you do not want to use send keys and the commands at startup. The below code also disables other features as well.
Sub SetStartupPropertiesNone()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty “StartupShowDBWindow”, DB_Boolean, False
ChangeProperty “StartupShowStatusBar”, DB_Boolean, False
ChangeProperty “AllowBuiltinToolbars”, DB_Boolean, False
ChangeProperty “AllowFullMenus”, DB_Boolean, False
ChangeProperty “AllowBreakIntoCode”, DB_Boolean, False
ChangeProperty “AllowSpecialKeys”, DB_Boolean, False
ChangeProperty “AllowBypassKey”, DB_Boolean, False
End Sub
I use this routine to essentially allow users to have full read – write rights to all objects, however, don’t give them the ability to get to objects to do anything. They need full access to run pre-set queries that modify data in tables. The database is also saved as an .MDE with a top level password… however, I digress.
Actually, It is quite easy to re-establish the shift bypass in a database if it has been disabled unless you change the object itself. Microsoft explains how to do this in one of its white papers on security.
As Hans stated, a user could still import the objects to another database……
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications