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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling an Access application to run 1

Status
Not open for further replies.

RCPD700

MIS
Jun 20, 2001
75
US
We have an MS Access application that my supervisor would like to have scheduled to run daily (on an NT 4.0 server). This application has no user interaction via forms etc, it runs a query which produces a report that ends up on the user's printer (same one every time).

Does anyone know if it possible to run an Access application (via the AT command or other) like this? We can modify the application to create an RTF output document which can be retrieved by the user when they arrive at the office if necessary. I can't think of how we can direct the output to the user's printer (which resides on another secure subnet).

Thanks in advance for any suggestions,

Jim (not a server OS guy)

Posted also in the NT 4.0 Server forum
 
Use the Windows Task Scheduler to run a Batch file which will open the Access file.

Within Access, set up an Autoexec macro which will run the required query and then print the report. To get the report to go to the required printer each time, set that printer as the user's default printer. Either have that printer as the user's default printer at all times, or set it as the default printer in the Batch file prior to opening Access.

Finally, have your macro then shut down the database again.

HTH
Lightning
 
use the windows task scheduler to open the Access db directly (no need for a batch file). first use the scheduler wizard (Add A task) to open your Access exe, then tweek the properties to look something like

"path to access exe" "path to db" {space in between}

then do what ligntning says..when you name a macro AutoExec, it launches when the db is opened (unless you hold down the shift key before clicking on it which is what you'll need to do when you do more design work).

as for the printer part--i dont know sorry. how about just sending the report thru email? if their printer path changes or no longer exists, it may honk up your process.

if this is going to only ONE user, you can set the printer up in the design of the report i think. in the report's design, choose Page Setup. on the PAGE tab, choose Use Specific Printer. choose the one you want. obviously you have to already have it set up on the machine that you're running the db on. i know this works because by mistake, i have set up reports using a color printer in my building near my desk. then i'd see reports printed by people in another city. i'd contact them and they'd say they couldnt find their reports on their printer. i'd have to go back in and change the setup back to DEFAULT PRINTER.
 
Thanks for the suggestions, however there is one problem... there is no Windows task scheduler on NT 4.0 Server as we know it on the Windows client. I need to find a way to run this application unattended -- probably using the AT command which I'm attempting to find good info on. Setting up the AUTOEXEC macro to run the query and then close the application is a "no brainer." Dealing with running the application unattended on an NT 4.0 Server is the problem.

As for the output, I'll probably have to make the application create a file containing the report in a directory the user can access. The server has no e-mail, and the user's printer is on our Sheriff's highly secured subnet.

Thanks again.
 
Start->Programs->MS Dos Window

At /? > c:\temp.txt

temp.txt contains:

[tt]
The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled
command.
/delete Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the
day (for example, next Thursday). If date is omitted, the
current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.

[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top