Solved

Remove Shift funtion

Posted on 1998-12-09
7
599 Views
Last Modified: 2011-09-20
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
Comment
Question by:bakery1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 7

Expert Comment

by:spiridonov
ID: 1970544
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
 
LVL 5

Expert Comment

by:dtomyn
ID: 1970545
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
 

Author Comment

by:bakery1
ID: 1970546
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 2

Expert Comment

by:joslad
ID: 1970547
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
 

Expert Comment

by:danieleliot
ID: 1970548
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
 
LVL 10

Accepted Solution

by:
brewdog earned 0 total points
ID: 1970549
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
 
LVL 5

Expert Comment

by:dtomyn
ID: 1970550
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question