Automated Backup Question

driver7408

Registered User.
Local time
Yesterday, 18:37
Joined
Feb 7, 2010
Messages
72
Hi all,

Kind of long- winded, but I want to get this right before I deploy it.
I am re-employing an Access 2007 database that I designed a few years ago, after making numerous improvements. This database is 3 tables. 1 table is personnel, another is files, and they are joined at a table that date stamps the files, when the files are read, and by whom. The db will be used by about 50-100 people , with a maximum of 5-10 using it at the same time. All they do is click on a button and it instantaneously updates the joining table with the date and their name through a couple of queries; nothing complicated. They have no tables fields sitting open or waiting. The db is split with an ACCDE format on the front-end, which is about 2.25 mb. I previously ran it without splitting it and it worked flawlessly.

Included in the front end of the db is a string of code utilizing the copyfile function, which I use to make a back-up copy of the backend. It creates a copy of the backend in a separate, predetermined folder, overwriting any other previous backups there. The code fires fine.

My concern is:

Is it ok to have this code execute (creating a backup) every time each user closes the database? Testing it with a few users at once, I noticed no ill affects. I was concerned about corruption/problems if a backup was made while other users were on the database at the same time. I am not too familiar with Access limitations when it comes to this stuff.

Otherwise I could have the admin create the backup manually. I just prefer as little requirement from them as possible, as well as current of a backup as possible.

Thanks in advance. This forum has helped me immensely.
 
I run backup of backend when last user closes down. I check for existence of the backend.laccdb file to see if backend is still in use. That file will not exist if no table is open.

Here is a snippet:

Code:
    Dim fso As FileSystemObject


    Dim bePath As String
    Dim fePath As String

    Dim status As Integer

    Dim backupFolder As String

    If gcfHandleErrors Then On Error GoTo RunBackup_Error

    bePath = TempVars("BE_Location").Value    'mod peter
    backupFolder = TempVars("Backup_Location").Value

    Set fso = New FileSystemObject

    Dim beFilename As String
    Dim beExtension As String


    beFilename = fso.GetBaseName(bePath)
    beExtension = fso.GetExtensionName(bePath)

 

    If fso.FileExists(fso.GetParentFolderName(bePath) & "\" & fso.GetBaseName(bePath) & ".laccdb") Then
        status = status + 1  'backend is in use
    End If
 
Thanks, I will look into that code. I could have that automate on the close event, therefore only doing the back up if nobody else is on the db, ie: when the last user has updated it.
 
I am pretty close... Can anyone tell me the VBA reference that returns the name of the current database (the one I am using)? I am going to use that with the .laccdb on the install path to confirm whether the file exists or not. That way it will specifically look for my database.
 

Users who are viewing this thread

Back
Top Bottom