Results 1 to 3 of 3
  1. #1
    Thomasso is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Nov 2016
    Location
    Czech Republic
    Posts
    277

    Automatically run VBA code every X minutes on a server

    Hello,



    I have a business Access application that I'm building and I want to automatically run multiple VBA functions every 5 minutes (for example synchronize bank transactions via an API and so on).

    The code is finished and running well manually, and even automatically using the form timer event, but I want to be able to run the code regardless of whether someone has the application open.

    So my thought was to create an ACCDE file and put it on our Windows Server 2019, which has MS Access Runtime installed. It's sitting there open at all times with a dummy form that runs the code every 5 minutes.

    This works for a while, but after some time, the synchronization stops. I suspect it's because the server user got logged off? Or what could be the problem there?
    The database is MS SQL Server, and I'm connecting via a connection string (Windows Authentication for client apps and SQL User for the server app).

    Can you please advise what is the most efficient and elegant way of doing this?

    Thanks a lot.

    Best regards,
    Tomas

  2. #2
    Join Date
    Apr 2017
    Posts
    1,776
    On server, create a scheduled event, which runs a windows script. This script activates ACCDE, runs procedures in your ACCDE file, and then deactivates ACCDE.

    You also can have the ACCDE running permanently, and skip activating/deactivating part, but then you have to set the ACCDE to be restarted automatically whenever the server is restarted, and to cope with cases where SCCDE is shot down unexpectedly.

  3. #3
    Thomasso is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Nov 2016
    Location
    Czech Republic
    Posts
    277
    Thank you, I'll google how to make windows scripts :-)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-04-2016, 06:59 AM
  2. Run a Macro every 5 minutes automatically
    By GonzaloYagueSunol in forum Forms
    Replies: 9
    Last Post: 09-14-2015, 07:52 AM
  3. Replies: 2
    Last Post: 08-19-2014, 07:07 PM
  4. Replies: 4
    Last Post: 06-12-2013, 10:20 AM
  5. Replies: 1
    Last Post: 12-04-2012, 09:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums