Results 1 to 10 of 10
  1. #1
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65

    Automated Backup


    Q: How to save a copy of a '_be' so that it can be synced without a data conflict?
    I use SugarSync to back up selected files and to ensure that my various computers have the current version. SugarSync runs in real time, updating each copy of the file as it is saved. This is fine with files that are saved "once in a while" but Access backend files are saved after every edit, meaning that Sugarsync not only creates literally hundreds of copies of the files, often tripping over itself in the process, but that it also causes data entry conflicts if it tries to copy the file whilst Access is writing to it.
    Ideally, I want to automate the process of copying the 'be' file into a separate directory when a session is closed, ie when I select the "Exit Database" option that I have on the switchboard (in the front end db). I suspect that this means running a macro or calling an outside batch file. Any recommendations?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Sounds reasonable. Did you look at any of the"similar" links at the bottom of this thread?

  3. #3
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65
    I usually do a lot of exploring of existing threads before I post questions myself, but it is not always straightforward to guess which keywords others might use in the same circumstances. On this occasion I ran out of ideas and hence the post.
    Anyway, thank you for your response - it was helpful as a link in a chain that led, after several generations of "similar" links, to a page on 'Tech on the Net' which looks promising. I'll post the solution if it all works out ok.

  4. #4
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    If think you should use some cmd commands to copy your file (using a batch file, as you said) and execute that batch file by a custom command button (i.e "Backup_DB")

    If you succeed, please let me know with a reply here. I have the same issues

  5. #5
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65
    Quote Originally Posted by Athar Khan View Post
    If think you should use some cmd commands to copy your file (using a batch file, as you said) and execute that batch file by a custom command button (i.e "Backup_DB")

    If you succeed, please let me know with a reply here. I have the same issues
    Athar,
    I have succeeded in the first stage - that of copying the database into a separate directory prior to closing Access. I have tried several different approaches and, although one works, I am not yet sure which one it is! I'll experiment a bit more and come back with a definitive answer, hopefully later this week.
    There is also a second stage that is necessary - copying the 'backup_DB' back into the active directory when Access is re-opened. I'll probably modify the shortcut link to run a batch files to copy the DB prior to starting Access, but again I'll experiment and share the outcome.

    I think that we all can gain a lot from other contributors' posts and so I will certainly add to that knowledge base when I "know what I'm doing"!

  6. #6
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    Thanks a lot for your positive response and expected contribution. I will be waiting for your next post here.
    Yes, you are right that we all can gain a lot from other contributors' posts

  7. #7
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    And if...

    What to do when backend is password protected... backend and frontend splitted?

    Regards!

  8. #8
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65
    After a week fully occupied with other things I have finally established a procedure which satisfies my requirements. I experimented with writing a module to be triggered by exiting Access but then realised that I needed the synced files (which may have been updated on another computer) to be set as the active files for my next session. My solution goes back to my early computing days when Windows was for wimps and real men used DOS, namely write a batch file and call it from the shortcut instead of opening Access directly!
    I also decided that I wanted some way of restoring the previous files in case anything went wrong with the automated process, so after a bit of fiddling, here is my batch file:
    Code:
    @echo off
    REM Copy active files to backup directory
    E:
    CD E:\AvizzeData\Backup
    Copy C:\ANdata\DorohoiDB4LIVE_be.mdb /y
    Copy E:\AvizzeData\ANavizDB.mdb /y
    
    REM Copy synced files to active directories
    C:
    CD C:\ANdata
    Copy DBsync\DorohoiDB4LIVE_be.mdb /y
    E:
    CD E:\AvizzeData
    Copy C:\ANdata\DBsync\ANavizDB.mdb /y
    
    REM Run Access database front end
    ANavizDB.mdb
    
    REM Copy active files to sync file directory
    C:
    CD C:\ANdata\DBsync
    Copy C:\ANdata\DorohoiDB4LIVE_be.mdb /y
    Copy E:\AvizzeData\ANavizDB.mdb /y
    
    pause
    The final 'pause' allows me to check that the process has run correctly - replace this with a 'Exit' once you are satisfied.
    SugarSync is configured to backup only the DBsync directory, and so is not confused by the intermediate saves within Access.
    Obviously you will need to substitute your own filenames and paths, and you have to modify any shortcut icons to call the batch file instead of opening Access first. A computer-specific batch file and shortcut are required if you have different configurations on different computers.

    Athar - I'm sorry if you were waiting for some sophisticated Access module but I found that this was the simplest and most controllable way of achieving what I wanted.
    Susy - I do have front end and backend split and in different directories. IIRC, the password is only for Access internal protection and the batch process should work unless your _be file is also write-protected.

    Good luck!

  9. #9
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    Thanks, I will try to implement it. Regards!

  10. #10
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    Thank you RoafTech. I was busy and couldn't see your post on time. I hope it will solve our problems

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

Similar Threads

  1. Replies: 5
    Last Post: 06-21-2015, 02:51 PM
  2. Backup your db
    By ranman256 in forum Access
    Replies: 1
    Last Post: 11-06-2014, 09:57 AM
  3. Backup
    By sergran in forum Programming
    Replies: 19
    Last Post: 07-17-2013, 12:27 AM
  4. Can't backup Db
    By wislndixie in forum Access
    Replies: 1
    Last Post: 08-19-2011, 01:36 PM
  5. Ezy BackUp
    By FogLine in forum Programming
    Replies: 0
    Last Post: 07-04-2010, 06:46 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