Create MDE programatically

  • Thread starter Thread starter GeorgeMar
  • Start date Start date
G

GeorgeMar

Does anyone know how to create an MDE through VBA? I
can't find any docs.

regards
george
 
It isn't documented, but this works

Dim x as New Access.Application

On error resume next

Kill strFileOut

x.SysCmd 603, strFileIn, strFileOut

The last 2 parameters are the file path for the MDB and MDE respectively.
Note you need to Kill strFileOut in the event that it already exists.
 
Works for me...never had a problem. You need to use the code outside of the
MDB you are trying to compile though.
 
Depends on how you define "safe". Undocumented means it works now, but it
may not work in a new version of Access (where "new version" may include
service packs). On the other hand, there's little reason for Microsoft to
remove the ability.
 
Hi Paul,

A quick question; is there a particular reason that you have used "On error
resume next" rather than a conventional error trapping routine?
O error GoTo ...._err
....
...._err:
MsgBox Error$
Resume ..._exit

I have adopted your advice to George into a function (works perfect!) and
was wondering if it would be better to include the above.

Thanks,

Alp
 
Back
Top