How to open the current database with password
I have a succesful code to open another database which runs as follows:
Dim StrPassword As String
StrPassword = “secret”
Dim db As DAO.Database
Set db = DBEngine.Workspaces(0).OpenDatabase(“C:bebe.mdb “, dbDriverComplete, False, “; PWD=” & StrPassword)
However i want to rewrite the code so that it opens not an external but the current database.
I tried to replace the path with the words CurrentDB but it didnt work.May i know where is my fault?
This code is written in the autoxec code of a dtatabase that is protected with a password.