Find an Encryption Password for an MS Access DB

Weirdly easy, actually.
Written by Jacob, November 2025
Jacob Brown
First, why are you doing this?

Please make good decisions. The information I give here is mainly for fixing your own mistakes or possibly breaking open a passed-down database or something similar.

How the heck?

Did you forget your password? Well you MIGHT be in luck... maybe...

Do you have access to the Front End file? Here's the easiest method. In the immediate window, just type this and it'll give you the connection string, which includes the password for MS Access Databases.

Copy to Clipboard
? CurrentDB.TableDefs("Table Name").Connect
What if I have no connection to the Front End?

Let's say you don't have access to the front end. Basically you can use this other method to get all connection strings from a database. There are two basic pieces of information you need to know for this to work.

  • 1. Linking an .accdb table to another .accdb stores the password in plain text in the system table MSysObjects

  • 2. You can open another database's tables using DAO recordsets in VBA.

    (if it's not encrypted)

Okay here we go. Create a new database (or just use some other database) and put this code into a module. All this function does is grab the database as an object, then loop through the connections. I put them into the immediate window with Debug.Print, but you can use any method you like.

Copy to Clipboard
Function getPassword()
 
'initialize DAO objects
Dim db As Database
Dim rs As Recordset

'open database
Set db = OpenDatabase("C:\\database.accdb")

'pull only the connections
Set rs = db.OpenRecordset("SELECT * FROM MSysObjects WHERE Connect is not null")

'loop through all objects and show them in the immediate window
Do While Not rs.EOF
    Debug.Print "Database: " & rs!Database & vbTab & " Connection: " & rs!Connect
    rs.MoveNext
Loop
 
'close and free the recordset and database (general cleaup of recordset objects)
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
 
End Function
That's All.

Yeah that's really all there is to it. Nothing more to say, really...

Have a question? See an error?

Contact

Check out our YouTube channel for video tutorials!

VBA Decoded Logo
VBA Decoded

©All Rights Reserved.