Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Export Function

Status
Not open for further replies.
Nov 24, 2003
57
US
I'm hoping that someone can help me with this. My company wants to create a query that will export the records to a table. This in itself is easy enough to do but the trick is they want it to be fully automated with no user interface. They want the export to happen at a specific time each night, which means that it would need to happen when the database isn't open or anything. Does anyone know a way of doing this? Any help would be appreciated. Thanks.
 
What version of windows are you running?

Any way, if you have a Access database that is set to run code when it opens, you can call that database with the windows task scheduler to open every day at a specific time.

ChaZ

Ascii dumb question, get a dumb Ansi
 
Running unattended ACCESS reports

We are running scheduled batch files for various reports at 30 min., daily, weekly and monthly intervals using this method. It may seem a bit of a kludge, but it does not require ACCESS to be running all the time, nor do you have to worry about what might start running when you manually start ACCESS. When the scheduler calls the application, it will automatically start, run and exit. If you are working with an instance of ACCESS open when the schedule kicks-off, it will just open another instance of ACCESS, then close it when it has finished. It will not interfere with what you have open other than grab some processor time and perhaps the focus.

Step 1.
Create a macro that will run your report using the actions "OutputTo" and "Quit".
When you select the OutputTo action format, file-and-path, and encoding, etc., be sure to set AutoStart to "NO"
When you select the Quit action, choose "EXIT" from its options.

Step 2.
Create a batch file (anyname.bat) with wordpad in the same directory as your database file containing the following information. Be sure that the info on the lines beginning with "path" and "start" does not word-wrap to a second line(turn off word-wrap). Use quotation marks where you see them and leave out the < and >.

c: (or drive name where your application resides)

path = %PATH%;<drive name>:\windows\command;<drive name>:\<path to your database file's location>;<drive name>:\<path to your msaccess.exe file>

start /wait msaccess.exe "<drive name>:\<path to your database file's location>\<your database file name>" /x "<name of Macro that will run your report>"

exit

Step 3.
Using whichever form of scheduler you have, set it up to call the batch file as often as needed.

You may test the batch file by clicking on it from the windows directory. The scheduler will also give you an option to manually test it.

Win N.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top