?
Solved

Remove Shift funtion

Posted on 1998-12-09
7
Medium Priority
?
600 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

752 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