Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 789
  • Last Modified:

Access Database Scheduled Task

Hey EE!

I'm currently working with Scheduled Tasks built to run a macro within our Access Databases. The trouble that comes about, is that seemingly at random, the task will simply not work, and the server is left with two instances of "msaccess.exe" running in the background.

The BATCH files I'm targeting with my tasks are something to the effect of...

"C:\Program Files\Microsoft Office\Office\msaccess.exe" "C:\Program Files\Microsoft Office\Office\samples\northwind.mdb" /Excl /X Add Products

*Note* The above is taken directly from M$'s website, and my macro is almost identical.

Running the task from within windows works like a charm, and the macro goes off without a hitch. On the other hand, letting it run over night as it's intended to seems to fail 50% of the time, if not more.

Has anyone experienced anything like this, or found a good work around?
0
troycsl
Asked:
troycsl
  • 2
1 Solution
 
Jeffrey CoachmanCommented:
This is the problem with any scheduled task...
What to do when something goes wrong.
My guess is that overnight the PC is on for so long that it:
Sleeps
Hibernates
...or goes into stand by mode.
I believe there are settings to "wake up" the PC, but not to turn it on if it shuts down (power loss, ...ect)

see my comments here:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28274912.html#a39594675

I always ask why the scheduled task in needed in the first place?
For example, if you need a daily or weekly total, then run the query but create a system to "select the current day or week"
This way you can perform the operation for any day/week, any time you like...

JeffCoachman
0
 
troycslAuthor Commented:
Thanks for your reply Jeff. This is actually running on a server, so it's definitely not sleeping/hibernating. I believe I found the issue, and I'm going to close the question with it.

stackoverflow.com/questions/9590514/running-ms-access-macro-using-batch-file-when-not-logged-in

My access database was pointing towards network drives rather than UNC paths. The referenced stackoverflow actually defines my problem exactly.
0
 
troycslAuthor Commented:
I found the answer on my own outside of EE, and it's the most satisfactory that's come through.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now