Solved

Access Database Scheduled Task

Posted on 2013-10-23
3
770 Views
Last Modified: 2013-11-06
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
Comment
Question by:troycsl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39594719
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
 

Accepted Solution

by:
troycsl earned 0 total points
ID: 39594780
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
 

Author Closing Comment

by:troycsl
ID: 39605095
I found the answer on my own outside of EE, and it's the most satisfactory that's come through.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question