Passing a parameter to an MDE with ShellExecute

C

Carl Rapson

I'm using the ShellExecute API function within my MDE to start another MDE.
I would like to pass a command-line parameter to the other MDE when it
starts, but I can't figure out how. Is there any way to pass a user-defined
command-line parameter to an MDE when it starts, particularly when starting
it with ShellExecute? If not, is there another way to start an MDE and pass
a parameter to it?

Thanks for any information,

Carl Rapson
 
M

Michel Walsh

Hi,


The standard command line MSAccess.exe allows a parameter /cmd. See the
topic "Startup command-line options" in the help file.


Hoping it may help,
Vanderghast, Access MVP
 
C

Carl Rapson

Michel,

I looked at the "/cmd" parameter, but I also noticed that I must execute
msaccess.exe in order to use that parameter. For example, I can use the
"/cmd" parameter if I do it as follows:

"c:\program files\microsoft office\office10\msaccess.exe" "\path\mymde.mde"
/cmd mycmd

but not if I use:

"\path\mymde.mde" /cmd mycmd

In the first case, I get the command-line parameter; in the second case, I
don't. My ShellExecute is currently executing the .mde file directly (the
second example above). I suppose I could change it to execute msaccess.exe
with my .mde as a parameter. I'll investigate that.

Thanks,

Carl
 

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