Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Mar 2003
    Elkins Park, Pennsylvania, USA
    Thanked 0 Times in 0 Posts

    Unattended Queries/Agents (Access 2002/XP)

    Hi, all. This should be short and sweet:

    Is there a way to have Access run a query unattended, e.g. at midnight when I'm home NOT working? We have a query connected to a snapshot that is generated during the night, and we'd like to query it while nobody is "in" it. I'm guessing that, at the very least, we'd have to leave my workstation (or some server) running and let Windows' Task Scheduler open the database and have an Auto macro kick it off... but I'm not even sure if that's possible or if it's the best way.

    Any ideas?
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Unattended Queries/Agents (Access 2002/XP)

    You can indeed let Windows' Task Scheduler open the database at a specific time. If the database contains a macro named AutoExec, it'll be run automatically. You can also specify any macro to be run in the command line:

    "C:Program FilesMicrosoft OfficeOffice10MSAccess.exe" "CatabasesMyDatabase.mdb" /x MyMacro

    Another possibility is to leave the database open all the time, and to keep a form in the database open all the time. This form should have an On Timer event procedure that checks the time and runs some code at the appropriate moment. You'd need to devise a way to prevent the code from running more than once a day, for example by keeping track of the date.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts