Link to home
Start Free TrialLog in
Avatar of mlcktmguy
mlcktmguyFlag for United States of America

asked on

Supress Shift Opton on Startup

To keep users out of our backend database we have a startup form that opens when the MDB is open.  The only option it gives the user is to exit the database.  All menu's are suppressed so this really is their only option, if they get to this form.  
We have users that are opening our backend database by holding the 'shift' key at startup and changing data direclty.  They have been told over and over not to do it and most have complied.  However, I would like to eliminate the possibility.

I checked into password protecting the database, which is easy enough.  I even made a test version of the app that works with a password protected backend.  However, I have been repeatedly warned that there are many free and effective utilities for breaking the password of an Access database.

The option I am looking into now is disabling the 'Shift' key option on startup.  This is very easy to do and I have code to do it internally in the MDB and I also found an MDB that will toggle the option externally on any MDB that you choose.

I have techiniques and code to implement both the password protect option and the disable 'Shift' option so I am not asking for those.

Due to the ease of breaking the password I am leaning toward disabling the 'Shift' on startup option.

My concern is that if something goes amiss I have also locked myself out of the database and would be much worse off that I was before.  I have an external routine to toggle the 'shift' option and I will have a 'hidden' spot on the startup screen to also toggle the opton if I ever have to get in to the backend.  I am still concerend about worst case scenario, the database is having issues and I am locked out also.

Again, I am not looking for coding solutions to these two options, I have those.

I am interested in what steps the EE developers recommend in this situation and what you have done to address a similar issue.

Are my fears of being permanently locked out of my own database by supressing the 'shift' on stratup option unfounded?

Avatar of Surone1
Surone1
Flag of Suriname image

there is software around to enable the shift option from outside the database as well.
another way is to make a secret (password protected) option to enable shift inside your project.
A Google search for "" returs 1,570,000 results. This is from the horse's mouth at:

http://support.microsoft.com/kb/826765
Function ap_DisableShift()
'This function disable the shift at startup. This action causes
'the Autoexec macro and Startup properties to always be executed.

On Error GoTo errDisableShift

Dim db As DAO.Database
Dim prop as DAO.Property
Const conPropNotFound = 3270

Set db = CurrentDb()

'This next line disables the shift key on startup.
db.Properties("AllowByPassKey") = False

'The function is successful.
Exit Function

errDisableShift:
'The first part of this error routine creates the "AllowByPassKey
'property if it does not exist.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function 'ap_DisableShift' did not complete successfully."
Exit Function
End If

End Function

Function ap_EnableShift()
'This function enables the SHIFT key at startup. This action causes
'the Autoexec macro and the Startup properties to be bypassed
'if the user holds down the SHIFT key when the user opens the database.

On Error GoTo errEnableShift

Dim db as DAO.Database
Dim prop as DAO.Property
Const conPropNotFound = 3270

Set db = CurrentDb()

'This next line of code disables the SHIFT key on startup.
db.Properties("AllowByPassKey") = True

'function successful
Exit Function

errEnableShift:
'The first part of this error routine creates the "AllowByPassKey
'property if it does not exist.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, True)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function 'ap_DisableShift' did not complete successfully."
Exit Function
End If

End Function

Open in new window

Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Everything you need is here:

The link below contains an MDB which allows you to 'set' and 'reset' the Shift Key Bypass from a REMOTE mdb.  It's very cool.

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html - scroll down the page to 'By Pass Shift Key Code'

More related links:
http://www.accessmvp.com/JConrad/accessjunkie/shiftkey.html

http://www.databasedev.co.uk/disable_shift_bypass.html

http://www.jamiessoftware.tk/propeditor/pe_jump.html  ' Full property editor
Avatar of mlcktmguy

ASKER

Apparently I wasn't clear when I put " Again, I am not looking for coding solutions to these two options, I have those." in my original post.

I already have everything I need to implement either option.


Are my fears of being permanently locked out of my own database by supressing the 'shift' on stratup option unfounded?
<Are my fears of being permanently locked out of my own database by supressing the 'shift' on stratup option unfounded?>

for what you described above, (imho) the only way you can be locked out, is when the db gets corrupted. so, you must have a backup copy of the db.
"Are my fears of being permanently locked out of my own database by supressing the 'shift' on stratup option unfounded?

Yes.  The tool I posted will give you total control over that.  Really, try it out ... you can turn on/off shift bypass 'remotely' using that tool.

mx
DatabaseMX: I had and tested the tool that you suggested prior to this post.  Yes it works on an uncorrupted database.

My concern is what Capicorn1 touched on, database corruption and how suppressing the 'shift' option might bite me there.  Currently, if the database becomes corrupted I can open it to do a compact/repair, which usually resolves the issue.  Will this tool work on a corrupted database?  No real way to know that since their are many differnt ways in which a database can become corrupt.

This data is from a software product that is distributed pretty widely and I have no real control over database backup schedules.  I can suggest and recommend daily backups but not enforce or ensure their execution.

I appreciate the comments and suggestions.  So far this discussion has enforced my concern over the possibility of being locked out of the database.

You could put the database on a web server and create a front-end (web app) to restrict access. Then you could control CRUD via queries and client-supplied parameters.
"Currently, if the database becomes corrupted I can open it to do a compact/repair, which usually resolves the issue. "

Well, the good news is .. you do *not* have to open the db to do a C&R.  You can:

1) Use the CompactDatabase method from another DB or
2) You can use This is an EXTREMELY handy little tool, which I use daily ...  

http://www.mvps.org/access/modules/mdl0039.htm

Been using that for years.  Load it into notepad first and adjust the paths accordingly.

So ... I don't see corruption re Shift Key bypass any issue whatsoever, because I'm 99.5% sure that turning off shift key bypass does not inhibit C&R ...

mx

"So far this discussion has enforced my concern over the possibility of being locked out of the database. '

See my last post :-)

mx
port the back-end database to SQL Server.
"port the back-end database to SQL Server"

Not an option
mlcktmguy:
You are making an issue out of a non-issue ... at pointed out here @ http:#a33654903

mx
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DatabaseMX:
"2) You can use This is an EXTREMELY handy little tool, which I use daily ...  
http://www.mvps.org/access/modules/mdl0039.htm
Been using that for years.  Load it into notepad first and adjust the paths accordingly. "

I do not have the permissions or authority to alter the registry of user machines.

You mentioned that I can "1) Use the CompactDatabase method from another DB"

How is this done?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I feel much more confident about not getting locked out with these two methods available.
Just remember to keep a spare set of keys :-)

mx