?
Solved

Access Database Scheduled Task

Posted on 2013-10-23
3
Medium Priority
?
780 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

770 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