Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Backing Up Data directory from within Framework.
Message
 
To
19/12/2002 09:47:16
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00734473
Message ID:
00734673
Views:
23
>Hello everybody!
>In our application we there is a time when users have to perform end of the year process. This process will make major modification to the current data. Before this process begins we would like to back up the all data in case if users will make a mistake so we can restore it to the original status. This process will begin when the users click on the command button from the modal form which is running in its own Datasession.
> To perform a backup we have to close all open files. We are able to close ALL files in the form's datasession but we can't close Database files in the Default datasession because of the running Framework thus we can't copy Database files.
>I was wondering if anybody ever done that or anything similar to that. Or any advise how to perform the process of backing up all files in the data directory while the Framework is running.
>Thank you very much for your help.
>Best Regards and Happy Holiday!
>Igor

This might not help, but in a vertical market app I've been working on I wanted to give the users an easy way to backup the data (plus be able to schedule it from within the app) w/o either of us having to talk to their IT department. I created a directory called "Cache" in my main application directory. In it, I put a good copy of the DBC, a few default files, plus the Stonefield meta data. Inside of the application there is a menu option that they can select that will backup files. I've got an object that then makes sure the database is open, does a ADBOBJECTS against it, then walks through all of the files found. It opens the table, does a COPY TO into a backup directory, then closes it. When it's done, I call another method that zips up the directory for me (so they can easily send me a copy of the data; or, if I decide to, I can automate it).

The idea is, I don't to make a backup of the DBC since I already have a good copy of it stored in the Cache directory. If I need to restore, I'll shutdown the app and launch the restoration process (which is another application). It will copy the files from the Cache directory and unzip the tables, then tell Stonefield to regenerate based on the metadata. This nice thing with this is that it automatically fixes those nasty problems when there is an issue with the DBC along with index problems in one step.

But, if you really need to close everything, take a look at the CCustFrm::CDBManageForm for ideas on how to close and reopen everything.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform