?
Solved

Disable Shift-Key get-around on load

Posted on 2001-07-05
8
Medium Priority
?
364 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 400 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
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: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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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 …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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 …

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