Access2003 and Windows Scheduler (Scheduled Tasks)

muskilh

Registered User.
Local time
Today, 00:14
Joined
Jun 8, 2009
Messages
14
Hi,

I'm trying to automate a few things with Access 2003. I have the code working fine in my .mdb file, including the AutoExec macro to run the code.

The issue I'm having is when I set Windows Scheduled Tasks to open my .mdb file, it doesn't get opened. It simply says "Could not start" as the "status" in Windows Scheduled Tasks.

Does anyone have any ideas of why this is not working?

Any insight can help.

Thanks,

Muskilh
 
Hi,

I'm trying to automate a few things with Access 2003. I have the code working fine in my .mdb file, including the AutoExec macro to run the code.

The issue I'm having is when I set Windows Scheduled Tasks to open my .mdb file, it doesn't get opened. It simply says "Could not start" as the "status" in Windows Scheduled Tasks.

Does anyone have any ideas of why this is not working?

Any insight can help.

Thanks,

Muskilh

i know 0 about windows security, but are you running it on a network? the does network have security measures that prevent this? my guess is that if YOU made the task yourself, the task should be able to run if you're logged onto the machine. the other issue might be the permissions on the file. got any of those? anyone else trying to open it? etc, etc...
 
I'm simply running it on my computer. I currently have the macro security set to low for this database. I'm testing the windows scheduler while I am still logged in (I'm setting the Schedule to run 1 minute from 'now').

I tried opening other things with my Windows Scheduler in the same fashion and I get the same problem.
 
A couple things.

1. If you want the task to run when you are away from your computer:
a. Supply your username and password to the task
b. Sometimes Logging-off prevents a task from running,
Try locking the computer instead.
(It shouldn't matter if you gave your username and password to the task, though)
2. I find it's better to have the Scheduler run a shortcut
pointing to the mdb, instead of running the mdb directly.
This is especially true if you have multiple versions of Access installed.
 
Last edited:
I usually run my access automation from VB Scripts and I have the scheduler activate the script instead of the database. Here is the code that I am using in case you would like to try this method instead. You can put the code in a notepad document and change the extension to .vbs .

Gregg

Code:
Option Explicit

dim oaccess

'execute another Access macro
set oaccess = createobject("access.application")
oaccess.opencurrentdatabase "C:\Access Database\My Database.mdb"
oaccess.docmd.runmacro "MyMacro"
oaccess.closecurrentdatabase
oaccess.quit
set oaccess=nothing


WScript.Quit(0)
 
Thanks for the advice everyone. I'm sure they'll be of use in the future.

Right now I got it to work by telling Windows Scheduled Tasks to "Only Run When Logged On".
 

Users who are viewing this thread

Back
Top Bottom