How to run VB from the Windows Task Scheduler?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dsatino
    Contributor
    • May 2010
    • 393

    How to run VB from the Windows Task Scheduler?

    Basically, all of my Front-end apps check to make sure that the backend data is up-to-date and, if not, launch the code to update the data. I'm going to keep this functionality, but I'd prefer it to be nothing more than fail safe.

    Basically, I just need an example of how to run the code from the Windows Task Scheduler.

    Thanks.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    I haven't tested this, but Have the Scheduler Open an Access Database at the appointed time. This DB will consist of nothing but an AutoExec Macro which will Call a Function that does all the work of Updating. The Function then Quits the DB when it has done its work.

    Comment

    • dsatino
      Contributor
      • May 2010
      • 393

      #3
      Do you have any experience setting up the task scheduler itself?

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Not really.

        Comment

        • beacon
          Contributor
          • Aug 2007
          • 579

          #5
          I usually write VBScripts that back up my databases that I use in Windows Task Scheduler. You may be able to do something similar (as ADezii suggested), if you're interested, where you have the VBScript open the database at a time when it won't be in use and have it run for a certain amount of time to ensure that the data has been updated, then close the database and end the script.

          I also have a subroutine that emails me everyday to let me know that the task was completed. I'm happy to share this with you if you'd like.

          All you have to do is put the script somewhere that can be accessed on your network, if you're running on a network, that doesn't require mapping a drive (I suggest the Temp folder), then create a new scheduled task, browse to find the script, then set the recurrence (daily, weekly, etc.). If you're on a network, you'll have to open the task after you create it and enter your login credentials in the task. If your network requires periodic changing of your password, you'll have to change the password on the task every time you change your login password. That's why I use the email subroutine...so I'll know if I forgot to change my password in the script.

          Let me know about the script. Otherwise I hope this helps and good luck,
          beacon

          Comment

          Working...