Example 1 : my database is not secure -> no problem :
Dim oAccess
Dim oWorkspace
Set oAccess = CreateObject("Access.Application")
oAccess.SetDefaultWorkgroupFile("c:\afac\System.mdw")
oAccess.OpenCurrentDatabase "c:\afac\test.mdb"
oAccess.DoCmd.RunMacro "Macro"
oAccess.CloseCurrentDatabase
oAccess.Quit
Example 2 : my database is secure -> problem : How can I say who is the user and what is the password ?
Dim oAccess
Dim oWorkspace
Set oAccess = CreateObject("Access.Application")
oAccess.SetDefaultWorkgroupFile("c:\afac\NewSystem.mdw")
oAccess.OpenCurrentDatabase "c:\afac\test.mdb" ' -> Microsoft Office Access can't open the database because it is missing, or opened exclusively by another user.
oAccess.DoCmd.RunMacro "Macro"
oAccess.CloseCurrentDatabase
oAccess.Quit