Opening access runtime with vbs

A

Adam Milligan

All-

This might be the wrong forum for this, but I imagine some of you might have
run into this before. I am trying to write a vbscript that will open an
access database. (It does other stuff too, but this is the part I am stuck
on.) Below is the vbs code:

dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "MSACCESS.exe " & chr(34) & "C:\Documents and Settings\All
Users\Application Data\IESAppsAscent\Ascent_fe.accdr" & chr(34)

When I run it, the Access runtime opens just fine but the database doesn't
open with it. I would think I would get an error if I typed something wrong.
Is there a secret trick to this when dealing with the 2007 runtime?

Thanks in advance.

Adam
 
A

Adam Milligan

Aha!

It was a WAD problem (working as designed). I forgot to include the /x
switch in the command to indicate that I wanted it to run the "Startup" macro
on startup. Sorry for clogging up the forum with un-needed questions.

Adam
 
J

Jeff Boyce

Adam

On the other hand, you've just provided some poor future poster with the
exact solution s/he needed!

Jeff
 

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