Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old November 17th, 2003, 12:43 AM
Authorized User
Points: 306, Level: 6
Points: 306, Level: 6 Points: 306, Level: 6 Points: 306, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , .
Posts: 54
Thanks: 2
Thanked 0 Times in 0 Posts
Default

To use the shift key to bypass the startup options and autoexec, go to your .MDB file (NOT the .MDE). If you are viewing it in Windows Explorer, hold down the SHIFT key and keep holding it down as you open the .MDB file.

Be sure to read your help files on the subject. The following is from MS ACCESS XP help file:
-------------------------------------
Ignore startup options
If you used the Startup dialog box (Tools menu) or created an AutoExec macro or an Open event procedure to specify what happens when you open a Microsoft Access application, you can bypass those settings to regain full access to your Access file.

Hold down the Bypass key (the SHIFT key) while you open the database.
Note You can disable the bypass key by writing a macro or Microsoft Visual Basic for Applications code that sets the AllowBypassKey property of the database to False.

---------------------------------
Here is some code that will allow you to disable the SHIFT key ... warning: follow the advice of everyone preceding my reply ... only execute this code in a BACKUP of the .MDB file.

This is also from the VBA Editor Help file in MS Access 2000 (could not find it in XP:
--------------------------------------

'The following SubRoutine sets the StartUp properties.
'It uses the general purpose procedure ChangeProperty to set the startup properties.
'WARNING: Make a copy of this .MDB file and open it before running this code. This will
' irreversably lock you out of the built-in menus and toolbars, once you close the .MDB file.
' Run ONLY once per copy. NEVER run it in the original .MDB file.

Function SetStartupProperties()
    'ChangeProperty "StartupForm", dbText, gcstr_Frm_Switch_Board ' The form to open on Start Up.
    ChangeProperty "StartupShowDBWindow", dbBoolean, False
    'ChangeProperty "StartupShowStatusBar", dbBoolean, False
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    ChangeProperty "AllowFullMenus", dbBoolean, False
    ChangeProperty "AllowBreakIntoCode", dbBoolean, False
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    ChangeProperty "AllowToolbarChanges", dbBoolean, False
    ChangeProperty "AllowShortcutMenus", dbBoolean, False
    'ChangeProperty "StartupMenuBar", dbText, "customStandardMenu"

    ' This is the ultimate that locks you out from using the "Shift" key to bypass at startup.
    ChangeProperty "AllowBypassKey", dbBoolean, False '<=== THIS DISABLES "SHIFT"!

End Function

'The general purpose procedure ChangeProperty attempts to set the startup
'property and, if the property isn't found, uses the CreateProperty method to append it to the Properties collection
'of the Database object. This is necessary because these properties don't appear in the Properties collection until
'they've been set or changed at least once.

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Database, prp As Property
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    If Err = conPropNotFoundError Then ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, _
                    varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function








--- Tom
Reply With Quote
Reply


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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Forms with Master/Multiple SubForms natwong Access 1 February 27th, 2007 01:01 PM
Forms and tables in Access 2003 marclf Access VBA 2 October 24th, 2006 07:10 AM
Hiding Tables/Forms Paula222 Access VBA 1 April 17th, 2006 02:59 PM
2 tables, 1 query, 1 form, cannot edit :( tanjuakio Access 2 June 24th, 2005 06:24 AM
SQL Injections Prevention phungleon Classic ASP Databases 1 April 8th, 2005 12:23 PM



All times are GMT -4. The time now is 05:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.