Results 1 to 5 of 5

Thread: Backup DB

  1. #1
    Join Date
    Feb 2004
    Location
    Colorado state
    Posts
    65

    Unanswered: Backup DB

    Hi All,
    Is there anyway that a db can be set to automatically back itself up before closing? Maybe some kind of "After Insert" event. Would also be interested in a auto synchronize if it is possible.

    Thanks,
    Mike

  2. #2
    Join Date
    May 2004
    Posts
    16
    You cannot back up (copy or zip) an open Access file, so an Access .mdb file cannot back itself up. You could write a .bat file that backed up the .mdb file before it started it but then it would take a couple of seconds to start. There are tools from FMS (www.fmsinc.com) that help with maintenance (Total Access Admin). I haven't used that tool but other FMS products are high quality. Within Access code you can export objects including tables and code modules so you can do limited sorts of "backups" depending on your intention. We do that all the time where we number the backups to not write over the previous backups.

    Can you be more precise as to your goal?

  3. #3
    Join Date
    Feb 2004
    Location
    Colorado state
    Posts
    65
    Hi Don
    My goal is this. Awhile back I asked the question about access security. My question was how can I protect the folder my dbase is in while still letting people from different terminals acces the db. I got not response. I have tried to protect the file but was unable to and still maintain useability. So I want to be able to backup the db often just in case a disgruntled worker decides to delete the db.

    Did I confuse you as much as I think I just confused myself?

    Do you have any suggestions?

    Thanks Mike

  4. #4
    Join Date
    Feb 2004
    Location
    Colorado state
    Posts
    65
    While browsing for sample databases I found this backup demo posted by OLDSOFTBOSS. It is for backing up open databases. I am VB illiterate, can anyone show me the way to set this up for my own application? Right now it is set up to backup winzip.

    I really appreciate your help.

    Mike
    Attached Files Attached Files

  5. #5
    Join Date
    May 2004
    Posts
    16
    I checked with one of my partners since he does our backup solutions. I didn't think one could back up/copy an open Access database but he says you can do it, but NOT RELIABLY. That is, Access data may still be in a main memory buffer and not flushed to the database yet, so you may be getting partial records/indexes and inconsistent data. We check the .ldb file before doing the backup (if the .ldb file is not there then no one is using the database).

    For security, there are many layers to be concerned with. If you have an NTFS file system (rather than FAT32) you can use Access control lists (ACLs) to control user permissions on the folder. From Windows Explorer, highlight the folder, right click, choose properties, then the Security tab. Add the user/group that you want to restrict, then for that user/group click the Advanced button and give them the needed permissions but do NOT give them "Delete" or "Delete Subfolders and Files" permissions. You will need to play around with a test application to get the permissions right.

    But, of course, if they have Access they can still get it and delete rows/tables, etc. So you have to protect the Access application also. And if the users are smart enough, then can connect to the database from Excel or other apps and delete critical data. So, there are many layers of protection. The first stage is using Access security to prevent users from getting outside of your forms. I recommend the Litwin/Getz 2 book set as the starting book. If you really want to, you can even have Access encrypt your data so that only Access (and not Excel, etc) can read it.

    In Access forms you can decide (without coding) to only allows users to add data but not view/edit existing data (the Data Entry property, in conjuction with the Allow Additions/Allow Deletions/Allow Edits properties). If you write code you can get more sophisticated about granting permissions and doing an audit trail.

    So, making copies/backups of the database regularly is a great idea. The sample code you posted does that, but if your files are in a fixed location you can just run .bat (batch) files just as easy. You can set up a Scheduled Task in the Control Panel and get as sophisticated as needed e.g. check the .ldb, run a .zip or copy, develop a naming convention, delete files older than x days old, etc.

    The long and short, bullet-proofing yourself from malicious users is difficult.
    Last edited by Don D; 05-31-04 at 17:12.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •