Mason11987
Mason11987

Reputation: 330

How to secure VBA code and Connection strings in MDB database

I have a MDB database with plenty of VBA code, there are also connection strings to database. I need to have both the connection strings hidden, and the VBA code unavailable. In general I need to disable all functionality that is granted through shift-clicking the database file.

I tried making an MDE but it seemed to have no actual impact even though no errors were thrown, the MDE is exactly as accessible.

Thanks!

Upvotes: 1

Views: 526

Answers (1)

Christian Specht
Christian Specht

Reputation: 36451

In addition to creating an MDE, you can:

At work, we have a "publish" process where we create an MDE and do the things linked above.


EDIT:
Creating an MDE is a realistic way to prevent access to the VBA code - MDEs contain no code and you can't edit forms and reports.
The only thing you can do in an MDE is opening the database window and view/edit the tables. But you can kind of prevent that by disabling shift-clicking and hiding the database window (see my links above).

Note that it's still possible to link the tables in another MS Access database and view/edit them. So there's no 100% proof way to secure anything that you put into a table.
But when you put the connection strings into the VBA code and completely remove the code by creating an MDE, it's not possible to get the connection string out of the MDE.

Upvotes: 1

Related Questions