Solved

Remove Shift funtion

Posted on 1998-12-09
7
594 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

943 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

6 Experts available now in Live!

Get 1:1 Help Now