I am trying to run a Macro that is contained within a password protected database.
If I use the following code it works when the database password is removed, but for security reasons I do not want to remove the password.
Dim ac As Access.Application
Set ac = New Access.Application
ac.OpenCurrentDatabase ".mdb", False
ac.Visible = False
ac.DoCmd.RunMacro "MacroName"
ac.CloseCurrentDatabase
I've tried using the following code, but it's expecting an SQL string from here....
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=".mdb"; "
conn.Properties("Jet OLEDB
atabase Password"
= "pwd"
conn.Open conn.ConnectionString
What can I do to open that password protected database and run the macro within the database.
Any help would be appreciated. Thanks in advance.
If I use the following code it works when the database password is removed, but for security reasons I do not want to remove the password.
Dim ac As Access.Application
Set ac = New Access.Application
ac.OpenCurrentDatabase ".mdb", False
ac.Visible = False
ac.DoCmd.RunMacro "MacroName"
ac.CloseCurrentDatabase
I've tried using the following code, but it's expecting an SQL string from here....
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=".mdb"; "
conn.Properties("Jet OLEDB
conn.Open conn.ConnectionString
What can I do to open that password protected database and run the macro within the database.
Any help would be appreciated. Thanks in advance.