Results 1 to 3 of 3
  1. #1
    rivereridanus is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    71

    Suggestions for regular automatic compacting of backend DB

    Hello everyone,



    I have created and manage an Access 2010 DB with a split backend and multiple front-ends for multiple users. My users leave their front ends open 24x7 (it's a 24x7 work environment) including when they leave for multiple days. For this reason I have implemented a timer which checks for a flag in a table, and the flag is raised when a user clicks a button to kick all the users out. I use this when something goes wrong in the backend db and I need to compact and repair it (and in the process break all the users' connections).

    Up until now this has worked out well. In fact it still does- but I have to be there to click the button to start the process, and have to remember to do it whenever it needs to be done.

    I want to figure out a way to automatically compact and repair the backend db (maybe 1x a week?), as well as back up the db without my intervention.
    Any suggestions beyond putting in a really long timer event?

    As always, Thanks for your help!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    I use a form timer to execute things just like that. I start the timer app and the default time is Set.

    Code:
      'get the current backend db
    sourceFile = vBackEndDb
       
       'compact
    Application.CompactRepair sourceFile, destinationFile
       
       'rename sourcefile as archive
    Name sourceFile As sourceFile & "_arc" & Format(Date, "yyyymmdd") & ".mdb"
       
        'rename current backend file
    Name destinationFile As vBackEndDb

  3. #3
    rivereridanus is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    71
    Alright, sounds like this is the best way to go then. Thanks for your input!

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

Similar Threads

  1. Replies: 3
    Last Post: 01-02-2014, 08:11 AM
  2. Regular expression pattern
    By jacjacjac in forum Programming
    Replies: 1
    Last Post: 12-23-2012, 08:52 PM
  3. db compacting
    By aiken_Bob in forum Access
    Replies: 5
    Last Post: 06-25-2010, 01:22 AM
  4. Compacting When Closing?
    By Sean04 in forum Access
    Replies: 5
    Last Post: 03-19-2010, 01:16 PM
  5. Using Regular Expression $ in Access Queries
    By rkdiekhoff in forum Queries
    Replies: 1
    Last Post: 01-20-2010, 12:50 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