Scripting access to secured database

akc42

New member
Local time
Today, 00:40
Joined
Mar 15, 2011
Messages
6
I am trying to script access to an Access database for use on the command line. The Access database is secured with a workgroup file.

Code:
Dim oApp, sWGF,myWS
Set sApp = CreateObject("Access.Application")
set sWGF = "C:\Users\Alan\Documents\Secured.mdw"
oApp.DBEngine.SystemDb = sWGF
WScript.echo "Workgroup " & sWGF
WScript.echo "SystemDb " & oApp.DBEngine.SystemDb
Set myWS = oApp.DBEngine.CreateWorkspace("New","Name","Password")
This code outputs the Secured.mdw filename for the workgroup, but the default System.mdw filename for the SystemDB. It fails to create the workspace saying the Name and Password are wrong (although they ARE correct for the Secured.mdw file)

There are lots of references elsewhere on the net that say you can only do this as the first thing inside an application, but that IS what I am doing.

I am not sure what I am doing wrong. Any ideas
 

Users who are viewing this thread

Back
Top Bottom