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.
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.
? CurrentDB.TableDefs("Table Name").ConnectLet'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.
(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.
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 FunctionYeah that's really all there is to it. Nothing more to say, really...