Secure-and-Lock-Your-Microsoft-Access

How to Secure and Lock Your Microsoft Access Database Files

Learn how to secure and lock MS Access database files with passwords, encryption, and ACCDE. Protect your data in simple steps.
Free tutorial series.

3
Video Parts
8
Min Read
$0
Free to Learn

You spent weeks — maybe months — building your Microsoft Access database. It holds important business data, customer records, or proprietary logic. The last thing you want is someone opening it, copying your work, or accidentally breaking something. This guide walks you through every practical method to secure and lock your Access database files, from simple password protection to advanced file compilation.

Why Database Security Matters

Microsoft Access is a powerful tool for small to medium-sized businesses, but it stores data as a regular file on disk — meaning anyone who has access to the file can potentially open it, edit it, or steal it. Unlike server-based databases, there is no built-in login system by default.

Whether you are sharing a database across a team, distributing a finished application to clients, or just keeping sensitive records, you need to think about:

  • Who can open the file at all
  • Who can edit the data inside
  • Who can view or change the design — forms, queries, VBA code

Good to know

Microsoft Access offers three main layers of security — file-level encryption (password), code-level protection (ACCDE), and interface-level locking (navigation pane). Using a combination of all three gives you the strongest protection.

🔐

Password & Encryption

Prevents anyone from opening the file without a password. Also encrypts the raw data.

🛡️

ACCDE Compilation

Locks forms, reports, and VBA code so users cannot view or change the design.

🗂️

Navigation Lock

Hides and locks the navigation pane so users stay inside your controlled interface.

Method 1 – Password Protect and Encrypt Your Database

The most essential security step is adding a password to your Access database. When you do this, Access also encrypts all the data in the file — so even if someone opens the raw file with a hex editor or another tool, the data appears as scrambled, unreadable bytes.

Before you start

Make a backup of your database first. If you forget the password, Microsoft cannot recover it for you, and you will be permanently locked out.

Step-by-step: Set a database password in Access

1

Close the database if it is already open. You must open it in a special mode to set a password, and you cannot do that while it is already open normally.

2

Open Access and click File → Open → Browse. Navigate to your database file (.accdb).

3

Click the small dropdown arrow next to the Open button (do not just click Open). From the dropdown, choose Open Exclusive. This ensures no one else can have the file open at the same time while you apply the password.

4

Once the database opens, go to File → Info → Encrypt with Password. The “Set Database Password” dialog will appear.

5

Type your password in the Password field, then type it again in the Verify field to confirm. Click OK.

6

You may see a message about “Row Level Locking will be ignored” — this is normal. Just click OK. Your database is now encrypted and password-protected.

Tip: From now on, every time someone tries to open the database, they will be asked for the password. Anyone without it simply cannot open the file. To remove the password later, open the file in Exclusive mode again and go to File → Info → Decrypt Database.

Method 2 – Compile to ACCDE (Lock Design and VBA Code)

Once you have finished building your database application and want to share it with users or clients, you should convert it to an ACCDE file. This is a compiled version of your database. Here is what it does:

  • All VBA code is compiled and removed from view — users cannot read or edit your code
  • Forms and reports are locked — users cannot switch to design view to modify them
  • The file runs faster because the code is pre-compiled
  • Your intellectual property — months of development work — is protected

Important

Always keep your original .accdb file as your development copy. The ACCDE file is for distribution only. You cannot convert an ACCDE back to an ACCDB — it is a one-way process.

How to create an ACCDE file

1

Open your original .accdb database in Access.

2

Go to File → Save As. Under “Database File Types”, choose Make ACCDE.

3

Choose where to save the new file and click Save. Access will compile the database and save a new .accde file.

4

Distribute the .accde file to your users. Keep the original .accdb in a safe location for future editing.

One limitation to know

An ACCDE file does not lock tables or queries. A knowledgeable user can still open the navigation pane and view data directly. This is why you should combine ACCDE with the navigation pane controls described in the next section.

Method 3 – Hide and Lock the Navigation Pane

The navigation pane is the panel on the left side of Access that shows all your tables, queries, forms, and reports. For a polished, professional application, you should hide it — and ideally lock it — so users can only interact with your database through the forms you have designed.

Option A – Hide the navigation pane via settings

1

Go to File → Options → Current Database.

2

Scroll down to the Navigation section and uncheck “Display Navigation Pane”.

3

Also in the same screen, under the Application Options area, consider setting a startup form so your database opens directly to a custom menu.

4

Press Ctrl+S to save. Close and reopen the database to see the change.

Watch out for the bypass key

A user who knows the trick can hold the Shift key while opening the database to bypass your startup settings and see the navigation pane. To block this, you need to disable the bypass key using a VBA macro — this is covered in the video playlist linked at the end of this article.

Option B – Lock the navigation pane with a VBA macro

You can use the LockNavigationPane action in a macro or VBA to prevent users from deleting or moving database objects. This runs automatically when the database opens. The VBA syntax is:

DoCmd.LockNavigationPane True

Place this line in your startup macro or in the Form_Open event of your main menu form. While this does not prevent the pane from being displayed, it stops users from deleting or cutting your database objects.

Best practice: Combine hiding the navigation pane (via Options) + disabling the bypass key (via VBA) + distributing as ACCDE. This three-layer approach is what professional Access developers use when shipping applications to clients.

Quick Comparison: Which Method Fits Your Needs

Security GoalPassword / EncryptionACCDE CompilationNav Pane Lock
Prevent unauthorized file openingYesNoNo
Encrypt raw data in the fileYesNoNo
Protect VBA code from viewingNoYesNo
Lock forms & reports from editingNoYesNo
Hide database objects from usersNoPartialYes
Control user interface flowNoNoYes
Suitable for client distributionPartialYesYes

Best Practices and Important Tips

Always keep a backup before adding security

Before you add a password, compile to ACCDE, or make any major change to your database, copy the file to a safe location. Losing your password means losing access permanently — Microsoft has no recovery option.

Use a strong, memorable password

Your password should be at least 12 characters, mixing letters, numbers, and symbols. Write it down and store it somewhere secure — a password manager is ideal. Do not use obvious choices like your company name or “password123”.

Combine file permissions with database security

Database-level security works best when paired with operating system file permissions. Store your backend database on a shared network folder where only authorized users have read/write access. The database password then acts as a second layer of protection.

Separate your front-end and back-end

A common Access architecture splits the database into two files: a back-end (containing the actual tables and data) kept on a server, and a front-end (containing forms, queries, and VBA code) distributed to users. This way, you distribute the front-end as an ACCDE and keep the sensitive data in a restricted location.

Error handling is critical in ACCDE files

When you compile to ACCDE, any unhandled VBA error can cause the application to crash without a helpful message. Before compiling, make sure every procedure in your code has proper error handling — use On Error GoTo blocks throughout your VBA code.

Frequently Asked Questions

Can I recover a forgotten Access database password?

No. Microsoft does not provide a recovery method. If you lose the password to an encrypted Access database, the data is effectively inaccessible through normal means. This is why keeping the password in a safe place — before you set it — is absolutely essential.

Does an ACCDE file still need a password?

Yes — and you should add one. An ACCDE locks your code and design, but anyone can still open the file and see your data unless you also add a password. Use both methods together.

What is the difference between ACCDB and ACCDE?

An .accdb file is the standard editable database format — it contains all your tables, queries, forms, reports, and editable VBA code. An .accde file is a compiled version where the VBA source code is removed and forms and reports are locked from design changes. Think of ACCDE as a “read-only application” version of your database.

Can users still see my tables if I use ACCDE?

Yes, surprisingly. ACCDE does not lock tables or queries. A user who opens the navigation pane can still view and edit data in your tables directly. This is why hiding and locking the navigation pane — and disabling the bypass key — is so important as a companion step.

Is Access security enough for sensitive business data?

For small teams and low-risk data, yes. But for high-compliance environments (healthcare, finance, legal), consider moving your data to a proper server-based database like SQL Server. Access can still be used as a front-end interface, connecting to the server for data storage where enterprise-grade security controls apply.

Download the practice files at skillheader.com

Watch the Full Series — Free on YouTube

This guide is based on the “Secure and Lock Access Database Files” playlist. Watch all three tutorial videos for hands-on walkthroughs of every method covered here.

3 videos · ~39 minutes · Microsoft Access & VBA · SkillHeader