Solved

Disable Shift-Key get-around on load

Posted on 2001-07-05
8
363 Views
Last Modified: 2008-03-06
Hi,

I don't know what the proper question is, but I have a program that loads only special menus and disables the database window and right-click, etc. on boot, but if the user knows to use the shift-key when they load the program, they can get around this.

I want to know how to create a .mde file that does not allow users to see the database windows or have right-mouse button options, etc. even if they hold down the shift key.

Can it be done?  How?

Thanks

Sean
0
Comment
Question by:seanmonk
[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
  • 4
  • 3
8 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 6256746
This link shows a way for the shift key:
http://www.mvps.org/access/modules/mdl0011.htm

Nic;o)
0
 
LVL 2

Accepted Solution

by:
Gudare earned 100 total points
ID: 6256765
Drop the following into a module and follow the instructions for usage. :)


Sub SetStartupProperties()

' Set the value below to FALSE to disallow entry into the database via
' Shift-Click. Set to true to allow again. In both cases go to the above
' line reading "SetStartupProperties", put the cursor within the text, then
' press F5 to run the code.


    ChangeProperty "AllowBypassKey", dbBoolean, True
   
End Sub

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

-Craig
0
 

Author Comment

by:seanmonk
ID: 6256808
Gudare,

I tried that, but got a type-mismatch on        
>> Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)

Any ideas?  What references do I need loaded?

Sean
0
Independent Software Vendors: 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!

 
LVL 2

Expert Comment

by:Gudare
ID: 6256828
You're in 2000, not 97. Problem is that this is a DAO reference. DAO 3.6 library should work, change all the declarations to DAO.property, DAO.Database, so on.
0
 

Author Comment

by:seanmonk
ID: 6256834
Gudare,

I removed the error stuff to see what would happen (since I was getting the type mismatch).

The code now reads as follows:



Sub SetStartupProperties()

   ChangeProperty "AllowBypassKey", dbBoolean, False
   
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer

   Dim dbs As Database, prp As Property

   Set dbs = CurrentDb
   dbs.Properties(strPropName) = varPropValue
   ChangeProperty = True

End Function



When I run it I get a "Property Not Found" error on the following line:

>>   dbs.Properties(strPropName) = varPropValue

Sean
0
 

Author Comment

by:seanmonk
ID: 6256871
Craig,

That worked great.  Thanks.

Another quick note if you have a second.  I thought that would protect my database, but it seems that people can still create a blank database and then import all my objects and see my data structure, etc.  How can I protect against that?

If this is a separate question, then let me know and I'll post it as such.

Thanks

Sean
0
 
LVL 2

Expert Comment

by:Gudare
ID: 6256897
Seperate question, yes, but no worries, not here for the points. :)

Short version, long story: Access DB Permissions. You need to remove their rights to the objects. Problem with this is then they can't get in. If you're trying to protect against thievery of information from people who aren't supposed to get in, then security is the way to go. If you're trying to protect against the people who need to get access to this stuff, you're basically SOL. Using an MDE file will help with some of it, but if they can access the file, they can import it.

The only true way to make sure they can't get their grubby mitts into the structure of the database is to run-time the database using the MS Office Developers edition, which I currently don't have access to so I can't walk you through it or confirm complete security against imports.

The real key to it is that the import procedure only cares about permission to the object. Without modifying the actual software of MSAccess, I know of no other way to secure your DB from it.

You *might* still want to post this as a new question, lord knows I'm far from knowing everything about hidden properties in an access DB, but I'm pretty positive it can't be done without mde'ing or runtiming the database.
0
 

Author Comment

by:seanmonk
ID: 6256918
Craig,

Thanks.  I'll think about exactly what I want to do and post the question.  It is complex, since I want to deal with a bunch of issues related to security, including logging in, restricting certain areas, etc.

Thanks again for your help

Ben
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

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.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

696 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