Create MDE programatically

G

GeorgeMar

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

regards
george
 
P

Paul Overway

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.
 
P

Paul Overway

Works for me...never had a problem. You need to use the code outside of the
MDB you are trying to compile though.
 
D

Douglas J. Steele

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.
 
A

Alp Bekisoglu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top