Chris6657456456
Chris6657456456

Reputation: 167

VBA Access security question: Detect if the instance of access is from Access.Application?

My file (c:\mydb.accbe) has protection against the shift bypass, hidden access object window protection, disabled ctrl-g, hotkey bypass protection, etc. Project is also password protected, then compiled, and encrypted.

The problem is any user with read access to that accde file can create a new access project and create an instance of the protected file of that project using this code:

Dim appAccess As Access.Application 
Set appAccess = CreateObject("Access.Application") 
appAccess.OpenCurrentDatabase = "c:\mydb.accbe"

Now they can call any public function of that instance, for example:

call appAccess.run("thisIsPublicFunctionIn_mydb")

I can see two potential ways to mitigate this: 1# Any potentially sensitive function would get an extra parameter that contains the 'security' code. 2# Add some security by obscurity by renaming all the functions to random numbers at the end.

Other then using a real programming language (sadly not an option), got any suggestions on how I can detect this or protect against it?

Upvotes: 1

Views: 148

Answers (2)

TheSmileyCoder
TheSmileyCoder

Reputation: 160

When the app is opened through automation the UserControl property is updateable, so that is not really an option.

You cannot prevent that from happening. Best you can do is use a SQL server backend, where you tightly control permissions on tables, and use procs (with permissions) to update sensitive data.

Upvotes: 2

Nathan_Sav
Nathan_Sav

Reputation: 8531

I believe that application.UserControl does something around this. I've just tried, and seems to be ok for opening via access.application

Upvotes: 1

Related Questions