Results 1 to 13 of 13

Thread: backup database

  1. #1
    Join Date
    Nov 2003
    Posts
    74

    Unhappy Unanswered: backup database

    hi,

    i wanted to have a database backup. which means that wherever the database the user is using, once it exit from it, i wanted to make a backup on it. i have tried to do it but however i have got an error "permission denied". this error is due to i cannot make a copy of the present database which is open.

    how can i overcome it???

    pls advice
    nono

  2. #2
    Join Date
    Oct 2003
    Posts
    706

    Thumbs down

    A database is really designed to be shared and updated by many people simultaneously. Therefore, the usual approaches for preserving the data don't assume that the database is truly "shut down" while it's being backed up. Instead, they make copies of the data using queries, viewing the database as "a collection of tables" not as "a disk file."

    The problem of "backing up the database," if one assumes such a constantly-multi-user environment, may also not be effectively served by "backing up the file now and then" anyhow. If a database crashes, or the user simply makes a "vewy big boo-boo," you might need to reconstruct exactly what the user did, and/or be able to "un-do" changes.

    I suggest that you review the topic of "replication," and also that you search the Internet or whatever for some choices in database-oriented backup tools that you can buy to solve this problem. They don't have to be expensive. But "data is priceless," and the issues involved in effectively backing it up and working with it are subtle.
    ChimneySweep(R): fast, automatic
    table repair at a click of the
    mouse! http://www.sundialservices.com

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    With Microsoft Access, you just need to archive a copy of the mdb file. Can you launch the Access database from a batch file like this:

    "C:\YourDirectory\YourDB.mdb"
    Rename C:\YourDirectory\Copy4.mdb C:\YourDirectory\Copy5.mdb
    Rename C:\YourDirectory\Copy3.mdb C:\YourDirectory\Copy4.mdb
    Rename C:\YourDirectory\Copy2.mdb C:\YourDirectory\Copy3.mdb
    Rename C:\YourDirectory\Copy1.mdb C:\YourDirectory\Copy2.mdb
    Rename C:\YourDirectory\YourDB.mdb C:\YourDirectory\Copy1.mdb

    This would maintain five historical copies of the database.

    Be aware that MS Access does not have the backup and admin capabilities of a Database Server system such as MSSQL.

    blindman

  4. #4
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    set access to trigger a batch file on exit

    I use an exellent backup tool called SecondCopy (www.centered.com), but do not trigger it from within Access though. However, I think you can set access to start a batch file with the following command to trigger a specific backup profile within SecondCopy:

    path\SecCopy.exe "Profile 1"

    SecondCopy have some examples here:

    http://www.centered.com/secondcopy/t...ml#TT_Shortcut

    If you can set a macro to run on exit, then use the RunApp action and point it to the batch file. I guess you should use a pause command for a couple of seconds, or perhaps run the profile twice in the same batch file to give access time to close and free up the mdb file. But also, you can set SecondCopy to try to copy the file even if it is open by access, which works fine for me, I am doing regular backups with SecondCopy on mdb files that are currently/always open.

    PS. I would like to know how to set a db to run code or maros on exit, regardless of how the db/app is closed.

    SecondCopy is shareware, works fully for 30 days, if you do not pay it continues to run all existing profiles but you cannot change or add anymore. But well worth the price (USD 29 I think) , excellent tool!

  5. #5
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Re: set access to trigger a batch file on exit

    ooops, should have been

    http://www.centered.com/secondcopy/t...ml#TT_Shortcut

    , whatever happened when I copied that link in Mozilla...

  6. #6
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Re: set access to trigger a batch file on exit

    ok, it seems that this board truncates the url.

    (/secondcopy/tips.html#TT_Shortcut)

  7. #7
    Join Date
    Nov 2003
    Posts
    74
    hi blindman,

    I am using FileCopy and i get the permission denied error. as what u have mentioned, i would need an archive of my database. but when should i trigger this code of renaming the database. and .... renaming the database will not be allow as my database was opened. am i right. pls guide me..... thanks!!!

    =-----------------------------------------------------------------------=

    hi kedaniel,

    the idea of using the shareware is good but however it was only for 30 days usage and no budget was given for my project. anyway thanks alot!

    pls advice
    nono

  8. #8
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369
    well, secondcopy continues to work with the backup profiles you manage to set up the first 30 days even if you dont register..., (you could ask the people in charge to register, if only as a nice gesture to the developers :-) )

    when setting up SC on a new computer is is easy to supply a Registry file for another person to easily establish the desired backup - Installing SC is a breeze.

    (Even Intel is on the SC customer list, they bundle it with an external backup solution I think. Centered.com has won Shareware utility of the year awerd several times for this tool. Within each backup profile one can even set SC to run external programs before and after the task. Profiles can be password protectd so that they cannot be changed later.)
    http://www.centered.com .

  9. #9
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    My bad! The last command should have been a copy, not a rename. Also, the rename command doesn't take a path for the second parameter (my DOS is rusty!). Try this:

    "C:\YourDirectory\YourDB.mdb"
    Delete C:\YourDirectory\Copy5.mdb
    Rename C:\YourDirectory\Copy4.mdb Copy5.mdb
    Rename C:\YourDirectory\Copy3.mdb Copy4.mdb
    Rename C:\YourDirectory\Copy2.mdb Copy3.mdb
    Rename C:\YourDirectory\Copy1.mdb Copy2.mdb
    Copy C:\YourDirectory\YourDB.mdb C:\YourDirectory\Copy1.mdb

    The first line runs opens your database. The second and succeeding lines should not execute until your database closes.

    blindman

  10. #10
    Join Date
    Nov 2003
    Posts
    74
    --------------------------------------------------------------------------
    The first line runs opens your database. The second and succeeding lines should not execute until your database closes.
    --------------------------------------------------------------------


    hi,

    so as what u have mentioned. i have to have my database closed first inorder to do the backup rite????

    pls advice
    nono

  11. #11
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I believe so. Remember that MS Access saves any data changes immediately upon moving to a new record, so it probably keeps tight controls on the data file.

    That's why I think your best bet is to have the user run a process that launches the database and then archives it upon return.

    blindman

  12. #12
    Join Date
    Nov 2003
    Posts
    74
    hi,

    what i want is to have database backup at the point where the database is closed. i actually want it to backup at the switchboard upload() function.

    pls advice
    nono

  13. #13
    Join Date
    Nov 2003
    Posts
    1,487
    Just for the heck of it, try something like this:

    Code:
    Dim db As Database
    Set db = CurrentDB
    db.Close
    FileCopy SourceName, DestinationName
    Doevents
    DoCmd.RunCommand acCmdOpenDatabase

Posting Permissions

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