Quit is leaving access open

  • Thread starter Thread starter Roofus
  • Start date Start date
R

Roofus

We are loading access and running a macro with the command line /x parameter.
The macro finishes with a Quit. The database is always closed but Access
remains open, but not all of the time. The batch file does not continue as
it's waiting for Access to close first, if we kill the process, the batch
file continues. There is no lock file present for the database so we a sure
its closed ok.

Any ideas what may cause this?

Using Office 2007, windows xp x64

Thanks, Steve
 
Steve,

Can you please let us know the details of the relevant steps in your batch
file?
 
The batch file simply states :

"C:\Program Files (x86)\Microsoft Office\Office12\msaccess"
"c:\data\Monday\Monday Refresh.mdb" /x Refresh
"C:\Program Files (x86)\Microsoft Office\Office12\msaccess"
"c:\data\Monday\Monday Refresh.mdb" /x Email Report1
"C:\Program Files (x86)\Microsoft Office\Office12\msaccess"
"c:\data\Monday\Monday Refresh.mdb" /x Email Report2

The first refresh macro ran fine and it dropped into "email report1", as you
can see its the same database, there was no lock left, it sent out the emails
and had closed the database but access was still showing in task manager,
once killed, the "email report2" loaded fine.

We have tried compact and repair, then re-created the database from scratch,
importing all objects in from the old. We run similar database's every day
all working the same with no problem.

The refresh macro is running vba to refresh excel spreadsheets with edternal
links to another access database, the email jobs use vba to access outlook to
send them.

Steve
 
Steve,

I don't think I have ever run multiple macros sequentially like this, from a
command line. So I'm afraid I have no direct experience.

One thing I find irregular is the space in the names of the macros Email
Report1 and Email Report2. I would not have expected them to work like
that. I would have expected you to need to put ""s around the macro name in
this case.

Do you have a Quit action in each of the 3 macros?

But how about this... why not just do it all in the one macro anyway. For
example, you could add a couple of RunMacro actions to the Refresh macro, to
run then Email Report1 and Email Report2 macros. And then your batch file
only needs to call Refresh.
 
Thanks Steve, yes we didnt expect it to work without the spaces but i seems
to be fine. Yes in this circumstance we could join all 3 together but there
are 17 more jobs that run after these, all from different database's so we
would just push the problem on to the next job sadly. Sometimes its the
Refresh that hangs, at the moment it seems to be the first email, its not
consistent.

Yes all do a Quit, i altered the quit from "Quit - Save all" to just "Quit -
Exit" but that didnt help either.

Steve
 
Back
Top