ACC2000: How to Start Access by Using the Windows NT Schedule Service
ID: Q230575
|
The information in this article applies to:
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).
SUMMARY
To start Microsoft Access by using the Microsoft Windows NT scheduling service, you must do the following:
- Create a batch file with the command line options that you want to run.
- On the Scheduler Service, instead of using a system account, log on as a user account that has Administrator rights.
NOTE: Using the system account does not work correctly. The Office Assistant pops up and Access stops responding (hangs). Also, the system account does not have a default printer so, in that case, you could not print reports in Access.
MORE INFORMATION
The following steps create an example script that runs an Access database:
-
On a Windows NT Server machine, make a copy of the sample database Northwind.mdb, and move it to the root directory of drive C.
-
Open that copy of the Northwind database.
-
Create the following new macro called Macro1:
Macro Name Condition Action
------------------------------
Macro1 OpenForm
Test1 Action Arguments
----------------------
OpenForm
Form Name: Customers
View: Form
Window Mode: Normal
-
Save the macro and close the database.
-
On the Start menu, point to Settings, and then click Control Panel.
- In Control Panel, open Services.
-
In the Services list, look for the service called Schedule. If you see it, skip to step 9.
However, if you do not see Schedule listed in the Services list, but you do see Task Scheduler in the list, close the Services dialog box, skip to the "Using the Task Scheduler" section, and proceed with those steps instead.
- In the list, double-click the Schedule service. This displays the Schedule dialog box.
-
In the Schedule dialog box, select Log on as This account, and click the Build (...) button.
-
Using Notepad, or any text editor, type the following lines:
C:
CD\Program Files\Microsoft Office\Office
Msaccess.exe C:\Northwind.mdb /x Macro1
where C:\Program Files\Microsoft Office\Office is the path to the Access executable program. Msaccess.exe may be in a different location on your computer. If so, you can use the Find command on the Start menu to locate it and determine the correct path.
-
Save the file to the root of your drive C as "MyTest.bat" (including the quotation marks).
-
To schedule the application to run, type the following at an MS-DOS prompt:
AT 4:30pm /interactive "C:\MyTest.bat"
NOTE: 4:30pm is an example. Use a time about 2 minutes ahead of the current time for this test.
When the time expires, Access should open, displaying the Customers form.
Using Task Scheduler
If you see Task Scheduler listed in the Services dialog box, you have probably installed Microsoft Internet Explorer 4.0 or later. Internet Explorer setup replaces the Schedule service with Task Scheduler. In this case, you cannot change the logon for the service. You must do so on a task-by-task basis. After completing steps 1 through 7 above, proceed with the following steps to demonstrate the example by using Task Scheduler:
-
Using Notepad, or any text editor, type the following lines:
C:
CD\Program Files\Microsoft Office\Office
Msaccess.exe C:\Northwind.mdb /x Macro1
where C:\Program Files\Microsoft Office\Office is the path to the Access executable program. Msaccess.exe may be in a different location on your computer. If so, you can use the Find command on the Start menu to locate it and determine the correct path.
-
Save the file to the root of your drive C as "MyTest.bat" (including the quotation marks).
-
In the \Winnt\Tasks folder in Windows NT explorer, double-click Add Scheduled Task.
This starts the Scheduled Task Wizard. Click Next.
- Click Browse.
- In the Select Program to Schedule dialog box, go to C:\.
- Select MyTest.bat and click Open.
-
Change the name of the task to MyTask.
- Click One time only and click Next.
- Change the Start Time to about 2 minutes ahead of the current time, and leave the Start Date at the current date.
- Click Next. You see the screen for the user account that the task will use. Type the current user name and password that you are currently logged in as.
- Click Finish.
- When the time expires, Access should open, displaying the Customers form.
Additional query words:
inf
Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto
|