You can do it with ADO and Jet 4 using the following method:
http://support.microsoft.com/?*id=240222
If you're using DAO and Jet 3, I'd try something like this:
(untested)
dim dbe as privdbengine, ws as workspace, db as database
set dbe = new dbengine
with dbe
.systemdb = "full path to securing mdw file"
.defaultuser = "a suitable username"
.defaultpassword = "that user's password"
set ws = .workspaces(0)
set db = ws.opendatabase ("full path to secured mdb file")
' do stuff here!
end with
At the indicated point, "do stuff here", you have (1) a worspace ws
which is using the proper secured workgroup file, and (2) a database
variable db which represents your secured database, opened for the
specified user, in the secured workspace. Then you can probably use
methods of the /current/ workspace and database, and /that/ workspace
and database, to establish the links.
I don't have Access here to check, so I can't do all the code for you.
But that should give you a start. I do not guarantee that it is
do-able, as I have never done it myself.
HTH,
TC