Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backups

Status
Not open for further replies.

andyk

Programmer
Jul 29, 2000
24
GB
Hi,

I've developed a small database that I would now like to deliver to a number of PCs to be used by people who are not too knowledgeable of PCs. I would like them to backup the data regularly to a Zip/CDW drive and to be able to create multiple backups on the same media e.g by allowing the creation of new directories or file names within the backup utility

Can anyone suggest the best way forward?

Also the application is still being developed and so the database/table structure is likely to change in the future. Any suggestions on how this can be managed from a client friendly point of view?

Many Thanks Andy.
 
Andy,
I would suggest a couple of things... first, if they are "Non-PC" users, you will have some challenge in getting them to backup data to a "Location" that they have to specifiy. Unless you can guarantee that the ZIP drive is always a particular drive letter, they will at a minimum have to "Pick" a destination. In that case, I would recommend using the ADIR() function, and placing the results into a list box/grid type format that allows them to see the drives/drictories contents, and select one.
After that, it is a relatively easy process to get them to press a "Backup" button. What I would do in that case, is simply select every table, one-by-one, and "Copy" it to the "Selected" location. You could do something like the following:

* The code below would go into your list box to set the "Location" of where they want the file to go. This would include full "Path" including Drive & Directory, which you'd have to pluck out of the listbox you build. Sorry for the theory, but I can't really illustrate it here, since I don't have objects to work with. If you cant' get this to work, let me know, and I'll provide more details).

lcLocation = LOCARRAY(lnArrayPick)
*
* Then, get each table
*
USE TABLE1 && name of a table
lcTableCopy = lcLocation + '\'+ALIAS()+".DBF"
COPY TO &lcTableCopy WITH PRODUCTION
*
USE TABLE2 && Next table
lcTableCopy = lcLocation + '\'+ALIAS()+".DBF"
COPY TO &lcTableCopy WITH PRODUCTION
*
Etc, until you have all tables. This requires some lengthy statments, but only needs "Maintainting" if you add additional tables. You can add all the fields you like, because it will take all fields, and their indexes. It may not be "Pretty", but it is effective. If you want to get "REALLY" fancy, you could add some additional code to read the directory for all databases, and then set up a DO WHILE... type loop, but really, there is no real need to be so fancy, unless you are going to frequently change/add tables.

This method will automatically overwrite any files in the destination, as long as SET SAFTEY is OFF.

Thanks,
-Scott

Please let me know if this has helped! s-)
 
Scott,

Thanks for that - I've tried it out in the command window and I'm confident I can get it to work that way. As a restore facility would you suggest using the COPY FILE command (with the database close)? Is this the safest way? It feels safer that emptying a table and then doing an APPEND FROM command.

Thanks Again,

Andy :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top