Is it possible to run a query in a batch mode?

G

Guest

I'm wondering if it's possible to run MS-Access in a batch mode (from
cmd.exe). I have some queries for the managers in my office that take a long
time to run and it would be nice if they could just launch the queries with
some sort of script that ran in the background.

Ultimately this is what I'm looking to make happen in batch mode:

1. Run query.
2. Export data to Excel.
3. Create pivot table (in Excel) from data exported into Excel.
4. Shut down MS-Access.

Is this possible? If so then what would be the best way to do this?
 
G

Guest

Write query, write a macro to output to Excel then shutdown, then create a
batch that calls out the .mdb with a /X (your macro here) and it will work!

One of these kind soles will most likely give you more detail but it can be
done fairly easily.

.....run a DOS based batch from inside Access and wait for the external
process to finish before the Access gets it hands on the data...now that's a
trick!...I have some borrowed code to do that if you need.
 
G

Guest

Thanks. Does the macro have to have an extension on it? I just tried this
and Access fired up but the macro didn't execute. Access just sat there.
 

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