Create an MDE File Programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
For the life of me, I've never understood a need to do this, but:

Dim a As Access.Application
Set a = New Access.Application
a.SysCmd 603, "db2.mdb", "db2.mde"
Set a = Nothing
 
That worked on a database that I did not set any security on. Thank you for
your help.

But, I want to do this on a database that has security set up. When I run
this program, a "Login" dialog box opens. I type my username and password,
and the "Login" dialog box reopens. This continues forever.

How do I handle a database with security settings? Your help is much
appreciated.

A word of explanation: What I am trying to do is deploy a database by
merely clicking a button. My "Deploy" Program performs about 5 actions in
addition to creating the MDE File, so it saves me some time.
 
If I add this line, then it works.

Dim a As Access.Application
Set a = New Access.Application
a.SetDefaultWorkgroupFile "dbSystem.mdw"
a.SysCmd 603, "db2.mdb", "db2.mde"
Set a = Nothing

It still brings up a "Login" Dialog box, into which I must enter my
password. Once I enter the password, it generates the MDE File. Basically,
I just needed to put myself in the correct workgroup.

Douglas, thank you very much for your help, as I never would have figured
out that "SysCmd 603" on my own.
 
Back
Top