Visual FoxPro Database Backup

Source: Internet
Author: User
Tags visual foxpro database

VFP database files are generally backed up in two forms. One is a record format, that is, a VFP table (. DBF) for storage. The advantage of this method is that the table data is backed up as is, note fields, common fields, and other special fields can be easily backed up and restored without special processing. The disadvantage is that once the record format is lost, the record cannot be recovered; the other is to back up records in text format. The advantage is that the text data is relatively stable and not easily damaged. The disadvantage is that special processing is required for the remarks field, common field, and other special fields, automatic backup and recovery are not easy.

Principles of backup and recovery for small Databases

The small database mentioned in this Article refers to a database whose file capacity cannot exceed one disk. For such a database, we commonly use the backup method: the copy to <path/backup1> command directly copies the database records and generates a backup1.dbf table file. If the original data table has a remarks field, a remarks file named backup1.fpt is generated at the same time, run the copy index indexfilename to <target path/filename1> command to back up the index file.

The second method is to use the copy to <path/backup1.txt> command to back up the original data table as a text file backup1.txt, use the copy structure to <path/backup1> command to back up the structure of the original data table as backup1.dbf. If the original data table has a remarks field, the remarks file backup1.fpt is generated. Note that when a text file is stored, do not use the copy to <path/backup1.txt> SDF command when the original data table has a remarks field, because the remarks file backup. FPT cannot be generated. The recovery method is to use the copy structure to command to restore the database structure, and then use the append from <path/backup1.txt> command to restore the data records, including the remarks field. Note that in this case, make sure that the remarks file backup1.fpt generated during Backup is intact.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.