• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

Remove Shift funtion

I have a *.mdb files with password protected, when I opene access 97 I entered password for login and i entered password for mdb file then before I enter to open mdb password If I hold down the Shift key and Enter the mdb file is opening with database table so I can see the tables and forms and query esc.

I want protect this function when I press Shift hold down and enter for open mdb files it should stop function

waiting for yr response
0
bakery1
Asked:
bakery1
1 Solution
 
Victor SpiridonovCommented:
You need to set AllowBypassKey property of the Application to false. You can find the code and more details if you search access help for allowbypasskey
0
 
dtomynCommented:
This is what I do:
1) Put the below functions into a Module
2) Have a secret account for yourself so that when you log in, you have an extra menu item (I call it "Shift Key")
ex. File Edit Help ShiftKey
ex. On your startup form have
If CurrentUser() = "MySpecialAccount" Then
    CommandBars("MainMenu").Controls(4).Visible = True 'SHIFT KEY DISABLER
Else
    CommandBars("MainMenu").Controls(4).Visible = False 'SHIFT KEY DISABLER
End If
3)Under ShiftKey add to Custom menu options, one that runs set Secure and one that runs set UnSecure
4) Log in with your secret account and disable the shift key!

Function SetSecureStartupProperties()
    'Put your startup form below in replace of "StartUp"
    ChangeProperty "StartupForm", dbText, "StartUp"
    ChangeProperty "StartupShowDBWindow", dbBoolean, False
    ChangeProperty "StartupShowStatusBar", dbBoolean, False
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    ChangeProperty "AllowFullMenus", dbBoolean, True
    ChangeProperty "AllowBreakIntoCode", dbBoolean, False
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    'The code below disables the bypass key
    ChangeProperty "AllowBypassKey", dbBoolean, False
    MsgBox ("SECURE")
End Function

Function SetUnSecureStartupProperties()
    'Put your startup form below in replace of "StartUp"
    ChangeProperty "StartupForm", dbText, "StartUp"
    ChangeProperty "StartupShowDBWindow", dbBoolean, False
    ChangeProperty "StartupShowStatusBar", dbBoolean, False
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    ChangeProperty "AllowFullMenus", dbBoolean, True
    ChangeProperty "AllowBreakIntoCode", dbBoolean, True
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    ChangeProperty "AllowBypassKey", dbBoolean, True
    MsgBox ("UNSECURE")
End Function

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


0
 
bakery1Author Commented:
I have already have my own main menu, after i enter your function it will create one more main menu with shiftkey

I want Cancel the function  press hold down the shiftkey when open the *.mdb files

answer pls
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
josladCommented:
You should look at question Q.10068391, which gives a very good solution to your problem.

To goto the question all you need to do is overtype the current question number in your browswer, with the question number given in the preceding para.

It is exactly what you need, using ALLOWBYPASS method.

regards
0
 
danieleliotCommented:
You may be able to launch access with the /runtime command option set. Search the help docs for more info. It basically emulates the run time version of access.

Let me know how you get on.
0
 
brewdogCommented:
how about creating a fake front-end database that, as its AutoExec macro, opens your other, real database? That way if the user holds down shift, all they'll see is the AutoExec macro.
0
 
dtomynCommented:
My current way with dealing with this is the same code I posted above (it's Microsoft's).  The way I call it is I have an AutoExec macro that checks the /cmd flag of the shortcut.  If it says "Unsecure" I enable the shift key, if it says "Secure" I disable the shift key.  This enables me to go to the client site to make changes if need be, while still having it secure. ...of course the "Secure" "Unsecure" suggestions could be anything, as long as it is something that the users will never guess.  Whenever I leave the client site I always "Secure" the application again and then delete the /cmd argument from the shortcut.

The code I run from my AutoExec macro looks like this...

Function UnsecureDatabaseCheck()
If Command() = "Unsecure" Then
    Call SetUnSecureStartupProperties
ElseIf Command() = "Secure" Then
    Call SetSecureStartupProperties
End If
End Function
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now