Solved

Remove Shift funtion

Posted on 1998-12-09
7
593 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
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now