If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > PC based Database Applications > Microsoft Access > Disable SHIFT + OPEN

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Oct 2003
Location: London
Posts: 326
Question Disable SHIFT + OPEN

Hi guys,

Is there a way to disable people opening my access for design by holding the shift when opening the database without securing the database?
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Jun 2004
Posts: 92
Reply With Quote
  #3 (permalink)  
Stuck on my opinions...
Join Date: Nov 2003
Posts: 1,487
I found this Text somewhere. It will help you out (I hope )

Disable Shift-Key ByPass

Preface: if you hold down the SHIFT key when loading up a database, any startup options you have are bypassed. If you have a database geared towards an end-user, you may wish to prevent this from happening--say, to prevent them from going to your source data tables.
The steps to bypass this "back door":
First off, always do this to a copy of the database; that way, you (the designer) always have a way in
Create a new module, with the following code
Public Sub SetBypassProperty()
	Const DB_Boolean As Long = 1
	ChangeProperty "AllowBypassKey", DB_Boolean, False
	' To re-enable shift bypass change the above line to True, hold down CTRL-G and in the ensuing window type
	' Call SetBypassProperty
End Sub
Private Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
	Dim dbs As Object, prp As Variant
	Const conPropNotFoundError = 3270
	Set dbs = CurrentDb
	On Error GoTo Change_Err
	dbs.Properties(strPropName) = varPropValue
	ChangeProperty = True
	Exit Function
	If Err = conPropNotFoundError Then	' Property not found.
		Set prp = dbs.CreateProperty(strPropName, _
			varPropType, varPropValue)
		dbs.Properties.Append prp
		Resume Next
		' Unknown error.
		ChangeProperty = False
		Resume Change_Bye
	End If
End Function
Save the module with a meaningful name like mod_Disable_Shift_Key (do not name it "AllowByPassKey")
Compile/save the module
Open the debug window by typing CTRL-G
In the ensuing window that opens, type Call SetBypassProperty
Close and save the module
Next time you start this database up, you will notice that holding down the shift key no longer bypasses any startup options.
How to Go Back to Allowing ByPass
It's always smart to keep a backup copy of the database that does not have the shift key disenabled. Nonetheless, if you are able to manipulate your way to the database window and can edit the module, then you can undo the bypass as follows:
Open the module in design view
Change the line ChangeProperty "AllowBypassKey", DB_Boolean, False to ChangeProperty "AllowBypassKey", DB_Boolean, True.
Compile the module
Open the debug window (CTRL-G)
Type the following line in the ensuing window: Call SetBypassProperty
Close & save the module

Reply With Quote
  #4 (permalink)  
Registered User
Join Date: Oct 2003
Location: London
Posts: 326

This is excellent for blocking access!

I have put this code into the database and to get to the desiging side of this, I have allowed special access keys on the startup options so that people can get the VB code (passworded) and disable this.

Its a long process of unlocking then closing then opening then modifying then locking then closing... again and again but it works to secure this.

Thanks, pal
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On