Solved

Disable Shift-Key get-around on load

Posted on 2001-07-05
8
357 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
  • 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 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