Solved

Scheduled task run Access app

Posted on 2011-02-25
6
878 Views
Last Modified: 2012-05-11
I have an access app that emails a pdf document when opened then closes.
I have it in this location: C:\Program Files\Microsoft Office\Office12\ACCWIZ
If I run it by double-clicking then it works fine but if I add it to task scheduler it just says 'running' and then does nothing.
Can any one help?
0
Comment
Question by:HKFuey
  • 3
  • 3
6 Comments
 
LVL 84
ID: 34978685
That's not the right location to your database. To run an Access database via the Task Scheduler, you should instead build a simple batch file that calls the database and use the Scheduler to call that batch file.

See this article for more information:

http://support.microsoft.com/kb/230575

Your batch file would look something like this:

@echo off
"full path to msaccess.exe" "full path to your database"

Save that as a batch file (with the .bat extension), and call that file from your Schd Task.

0
 

Author Comment

by:HKFuey
ID: 34978986
I need to put the database in ACCWIZ as otherwise I get a security message on Access startup and I need it to run unattended. (I only have Access runtime on this server, not full access)

I created the bat file and it opens the DB from that location, so I add it to a new task and nothing happens.
: (

0
 
LVL 84
ID: 34979023
Your database should be located in a Trusted Location. Generally that's the Users/Public location, and it is a very good idea to specify that the location you choose is, in fact, set to be a Trusted Location by Office. This is important, since in many cases the Program Files location is NOT a Trusted Location, and your database will NOT work if placed in that folder.

Did you review the link I supplied? There are certain caveats to insuring your Access database will run, especially insuring that the login you use has the needed permissions to actually run the program.

Also, does your Access database have a Startup form, or an AutoExec macro that will automatically launch a process (or form) when starting? If it does not, then the Access app would simply open, and do nothing else.

0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:HKFuey
ID: 34979128
I do have a form with VBA that opens automatically, runs the code, then closes the DB.

If I put the DB in Users/Public I still get the security message on open and I can't change trust settings in Runtime Access. (I changed the Macro settings in XL but it made no difference)

On the task I have tried Domain Administrator, Computer Administrator and my own login (Which has admin rights)

BTW this did work up until a couple of weeks ago, I wonder if an MS update broke it??

I have a 2003 server maybe I will install the Runtime Access on there and try again.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 34979190
<BTW this did work up until a couple of weeks ago, I wonder if an MS update broke it??>

That would be a good starting point. I'm not sure how you'd troubleshoot that, but as a start, build a simple database that does nothing more than open a form and display something, then place that in the SAME directory and build a Task to open that test database.

If that test db works, then there's something wrong with your database.

If that test db does not work, then I'd begin to suspect issues with permissions, updates, etc.

0
 

Author Closing Comment

by:HKFuey
ID: 34980006
LSM thanks for the help, in the end I changed the task to: -

1. Run with highest privileges
2. Run only when user is logged on

Not sure which made it work but not changing it now it works (very happy!)
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now