Solved

Disable Shift-Key get-around on load

Posted on 2001-07-05
8
324 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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 Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

760 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

20 Experts available now in Live!

Get 1:1 Help Now