Protect Your Access VBA Code from Reverse Engineering
Compile Access database macros into native DLLs — your business logic, SQL routines, and data export tools stay hidden inside compiled bytecode.
Why VBA Password Protection Fails for Access
Access databases with VBA modules face a unique risk: the .accdb file contains both data and code in a single package. The built-in VBA project password can be removed in seconds using freely available tools, exposing your business logic, SQL queries, validation rules, and data processing algorithms.
Even converting to .accde/.mde format offers limited protection — the VBA code is compiled to p-code but remains recoverable with specialized decompilers. For commercial Access applications and database tools, this is not acceptable.
The Solution: Compile Access VBA to Native DLLs
VBA Padlock goes beyond .accde protection. It compiles
your VBA modules into native 32-bit and 64-bit DLLs, replacing readable source
code with protected bytecode. The compiled DLL has full access to
Application.CurrentDb,
DoCmd, and the entire DAO engine — your code works identically, but cannot be decompiled.
Your Access database (.accdb) keeps its forms, reports, queries, and tables intact. A thin VBA Bridge module handles communication between Access and the compiled DLL. Users open the database and work normally — they never see your protected code.
Write
Write your Access VBA modules in VBA Padlock Studio with full syntax highlighting and autocomplete.
Compile
Click Publish to compile into signed 32-bit and 64-bit DLLs. A VBA Bridge is generated automatically.
Distribute
Ship your .accdb with the bin/ folder. Users open the database normally — the DLL handles everything.
See It in Action
Left: your protected code compiled into the DLL. Right: the thin VBA caller in your Access database.
Function ExportToCSV(TableName, FilePath, Delimiter)
Dim DB, RS, Stream, FieldCount, i
Set DB = Application.CurrentDb
Set RS = DB.OpenRecordset(TableName)
Set Stream = CreateObject("ADODB.Stream")
Stream.Type = 2
Stream.Charset = "UTF-8"
Stream.Open
' Write header row
For i = 0 To RS.Fields.Count - 1
If i > 0 Then Stream.WriteText Delimiter
Stream.WriteText RS.Fields(i).Name
Next i
Stream.WriteText vbCrLf
' Write data rows
Do While Not RS.EOF
For i = 0 To RS.Fields.Count - 1
If i > 0 Then Stream.WriteText Delimiter
Stream.WriteText Nz(RS.Fields(i).Value, "")
Next i
Stream.WriteText vbCrLf
RS.MoveNext
Loop
Stream.SaveToFile FilePath, 2
Stream.Close: RS.Close
ExportToCSV = True
End Function Sub ExportCustomers()
Dim FilePath As String
Dim Success As Variant
FilePath = CurrentProject.Path _
& "\Customers.csv"
Success = VBAPL_Execute( _
"ExportToCSV", _
"Customers", FilePath, ";")
If Success Then
MsgBox "Export complete!", _
vbInformation
End If
End Sub Access VBA Protection in Action
Real examples from Access projects protected with VBA Padlock.
What You Can Protect in Access
VBA Padlock supports all Access VBA scenarios — from database utilities to complete commercial Access applications.
Database Business Logic
Protect proprietary validation rules, calculation engines, and workflow automation that power your Access applications.
Data Export Tools
Secure CSV, JSON, and XML export routines that process sensitive database records with custom formatting.
SQL Query Engines
Hide advanced query builders, dynamic SQL generators, and reporting logic inside compiled DLLs.
Form Automation
Wire compiled DLL functions to Access forms and reports. Event handlers call your protected code seamlessly.
Access Application Distribution
Distribute complete Access applications with protected business logic. End users run the .accdb file normally.
Licensing & Activation
Add hardware-locked license keys, trial periods, and online activation to any Access VBA project — built into the DLL.
Access-Specific Notes
- Use
Application.CurrentDb(not justCurrentDb) inside compiled scripts. - The Access database must be in a writable location for license storage.
- Filter out system tables (MSys* prefix) when iterating TableDefs.
Need a step-by-step walkthrough?
Read the dedicated Access tutorial
Follow the full process to protect an Access database with VBA Padlock.
Frequently Asked Questions
Can VBA Padlock compile VBA code from an Access .accdb database?
Does compiled code have access to Application.CurrentDb?
How do I protect Access forms that call VBA functions?
Can I distribute a protected Access application to end users?
Does VBA Padlock protect my SQL queries inside the Access file?
Ready to Secure Your VBA Code?
Download VBA Padlock and start compiling, protecting, and licensing your VBA macros today.
Related Pages
Protect Excel workbooks, add-ins, and UDFs
Protect document templates and mail merge
Protect presentation macros and add-ins
How the compilation pipeline works
Why you need a VBA compiler and how it works