Launching Access using VBS

Q

Question Boy

I am using a vbs script to launch Access (see below). Everything works
except the /ro command lines switch. Can anyone help me rectify my code so
that the db open in a read-only state.

What is puzzling me even further is the fact that when the db does open it
indicates that the db is opening in read-only mode, but it still allows me to
make changes, so it isn't really in read-only mode, but then why the message?

strVBAPath returns the path back to the location of the executing script
which is in the same dir as the db itself.

strAccPath = strProgPath &_
"\Microsoft Office\OFFICE11\msaccess.exe"

strComTxt = "%comspec% /c echo on & " &_
Left(strAccPath,1) & ": & cd " & chr(34) &_
strAccPath & chr(34) &_
" & msaccess.exe " & chr(34) & strVBSPath & "\" & strFrontEnd &_
chr(34) & " /ro "
objShellDb.Run strComTxt

Thank you,

QB
 

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