What if Commandline contains spaces

P

Prashant Shah

Res. All,
We can start Microsoft access mdb file with a particular workgroup
file with a specific user from Vb. But it causes errors like "Microsoft
access can not recognize the command line arguments", if the path of the mdb
file or the workgroup file contains spaces such as "C:\Program
files\Skinsoft\Skinsoft.mdb".

What is the correct command-line in this situation,
Thanks in advance,
Yours,
Prashant
 
P

Prashant Shah

Res. Sir,
Thanks for the help. But it does not work. Any other solution?

Yours
Prashant
 
P

Prashant Shah

Res. Sir,
Thanks for the reply.
Acctually I have made a program foir skin specialists. I want to run it
from a vb exe file into the access program via shell function.
The commandline argument passed in the shell function in vb is something
like this. I have not put the inverted commas yet. The program does not run
with or without them.

x = Shell("C:\Program files\Microsoft Office\Office\Msaccess.exe C:\Program
files \Skinsoft\Skinsoft.mde /User abc /Pwd pqr/Wrkgrp C:\Program
files\Skinsoft\Derma.mdw", vbMaximizedFocus)


Yours
Prashant
 
D

Douglas J. Steele

x = Shell("""C:\Program files\Microsoft Office\Office\Msaccess.exe""
""C:\Program
files \Skinsoft\Skinsoft.mde"" /User abc /Pwd pqr/Wrkgrp ""C:\Program
files\Skinsoft\Derma.mdw""", vbMaximizedFocus)

Anytime you have two double quotes in a row, it gets translated to a single
double quote, so the first argument to Shell is really:

"C:\Program files\Microsoft Office\Office\Msaccess.exe" "C:\Program
files \Skinsoft\Skinsoft.mde" /User abc /Pwd pqr/Wrkgrp "C:\Program
files\Skinsoft\Derma.mdw"
 

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