Skip to content

Protect an Access Database

You’ve built an Access application (data exports, reporting, business rules in VBA), and you want to distribute it without exposing your source code. In this tutorial you’ll protect an .accdb database with the automatic workflow: open, review, produce. We’ll use the bundled DataExport example as our guide, but every step applies unchanged to your own database.

What you’ll get:

  • A protected copy (DataExport_protected.accdb) whose VBA works exactly as before
  • A compiled, encrypted DLL containing your module logic
  • (Optional) Licensing with activation keys

Time needed: 10-15 minutes


  1. Launch VBA Padlock and click Open Office File (Ctrl+O) in the Protect tab

  2. Select your database: for this tutorial, DataExport.accdb, which contains a DataExport module (CSV/JSON/Excel exports, table backup, SQL helpers) and a Demo module driving it

  3. VBA Padlock extracts the VBA modules and analyzes them automatically

The Project Explorer fills with your modules and their verdict badges, and a DataExport.vbapadlock project folder appears next to the file.


Click View Report. For a database like DataExport you’ll see:

  • The DataExport and Demo standard modules: every procedure -> DLL.
  • Form and report modules: their code (including event handlers like Form_Load) stays in the database; Access only fires events on code living in those modules.

If your code uses symbolic constants (acExportDelim, acViewNormal, …), open References: AccessConstants (~1,200 ac* constants) and OfficeConstants are pre-selected for Access projects.


  1. Optionally review Project Info (title, version, copyright, DLL name; defaults are pre-filled)

  2. Click Produce Protected Office File, or Test Run (Ctrl+F5) to produce and open it in Access

  3. On success, your folder contains:

DataExport\
├── DataExport.accdb (your source - keep it private!)
├── DataExport.vbapadlock\ (project settings)
├── DataExport_protected.accdb (ship this)
└── bin\
├── DataExportrun32.dll
├── DataExportrun64.dll
└── DataExport.dll

Your original database is never modified; Produce always writes to a copy.


  1. Open DataExport_protected.accdb in Access and enable content

  2. Run the Demo_* subs (or ShowMenu) from the VBA editor (Alt+F11F5 on a Demo sub): exports, backups, SQL helpers all behave exactly as before

  3. Look at the DataExport module: the procedures are now one-line wrappers calling the compiled DLL via the VBAPLBridge module; your logic is gone from the file

The protected Access database running compiled VBA


Licensing works identically for every Office host:

  1. Licensing Features tab → Activation Settings: check “Activation key is required to run the protected VBA application”, optionally with hardware-locked keys

  2. Produce again: licensing rules are baked into the DLL, so the protected copy must be rebuilt

  3. Key Generator: generate a test key for your own Hardware ID and verify the activation dialog appears when you run a protected routine

The Excel tutorial’s licensing section covers the options in more detail; everything there applies to Access too.


Click Distribute in the Protect tab and create a ZIP or folder copy. The protected database and its bin\ folder must always travel together:

DataExport_v1.0.zip
├── DataExport_protected.accdb
└── bin\
├── DataExportrun32.dll
├── DataExportrun64.dll
└── DataExport.dll

Protect an Excel Workbook

The most detailed host tutorial, including full licensing setup. Read the guide

Setting Up Licensing

Trial periods, activation keys, and hardware locking. Read the guide

Create an Installer

Ship your database as a professional Windows setup. View Reference