CM Table Repair Utility
Version 2005b
Copyright (c) 1995-2005 CompuMotor Company, Sofia, Bulgaria.
All Rights Reserved.
Support site: www.cmstory.com
============================
DESCRIPTION
Check and repair utility for Visual FoxPro, FoxPro and other DBF tables. You can see and repair nearly all items in the
header and structure of the table and memo files. It can be called from code to automatically repair bad headers.
REGISTRATION
Unregistered version is for testing purposes and works in development environment only. To use this utility you need to
obtain (purchase) registered copy. Please contact through support web site (or
send a message) and we will
sent to you further details and
license conditions. With registered version you can use full capacity of the
utility, can include it in your end user software product to distribute in this way to
your end users.
REQUIREMENTS
Application consists from one run-time file: cmrepair.app. This is a Visual FoxPro application, so you need VFP
installed on your system. It was tested with VFP 7, 8 and 9. It should work with VFP 6, but we are not testing our
applications with this version of VFP any more.
WARNING
Please backup data before repairing. This utility can write in the tables and memo files at low level, so be careful.
WARRANTY
This program is provided "as is" without any kind of warranty. The author doesn't take any responsibilities for
any damages or data loss.
MORE NOTES
It is well known, that if a FoxPro program (any version)
appends/writes to a table and computer crashes, the table becomes bad (corrupted). Next time when FoxPro tries to open
it, an error appears, like:
For several years of working with many and large data massifs, we discovered that in 99 % it is possible to
recover tables and memo files with small or no loss of information.
One of the problems occurs when FoxPro appends records. FoxPro engine writes buffers on disk in this order: first
changes record number in the header of the table, and afterwards changes the size of the files and writes data. Better way is
to reverse order of this two operations, but it is embedded in the Foxpro engine.
We are using this utility with success a lot of years.
Any
comments, ideas, suggestions and bug reports are appreciated. Please send them through
support web site (or
send a message).
EXAMPLES FOR USAGE
In package are included 2 PRG files, example_1table.prg
and example_1folder.prg.
You can explore and run them in Visual Foxpro to see how CM Table Repair works. You can also run directly
cmrepair.app. Here are more examples to call cmrepair.app.
Place | Parameter | Type | Compulsory | Defaults to | Description |
1 | cPathName | input | no | "" |
Variant 1. Valid table (full path and name) - table to check and repair. Variant 2. Valid directory (full path with end slash) - folder to check or default directory for selection of table to check. If empty - user manually have to select table for the checking. |
2 | lAutoChange | input | no | .f. | If .t. - auto-repair mode. Repairs corrupted table and memo files of the given table with cPathName. |
3 | nAutoRiskRecords | input | no | 5 | Specifies how many records maximum can be truncated in auto-repair mode, or so called "risk records". |
4 | cPathNameLogFile | input | no | AddBS(JustPath(SYS(16,0))) + "cmrepair.log" | Path and name of the log file to record any activity in auto-repair mode. If the file does not exists, it will be created first time CM Table Repair needs to write in it. If not given - default place for it is in same folder as main calling program. |
5 | tlSilence | input | no | .f. | If .t. - silence mode, no messages and no interface in auto-repair mode. You can get result info from a_TableCheckInfo and other output parameters. |
6 | tnTablesToCheck | output | no | 0 |
How many tables are given to check in auto-repair mode. Equals to 1 if a file is given to be checked, and, number of tables in the given folder if folder is given to be checked (or equals to ALEN(a_TableCheckInfo,1)). |
7 | tnTablesChecked | output | no | 0 | How many tables are checked from the given to check in auto-repair mode. |
8 | tnTablesCorrupted | output | no | 0 | How many tables are corrupted from the checked tables in auto-repair mode. |
9 | tnTablesAutoRepaired | output | no | 0 | How many tables are auto-repaired from the corrupted tables in auto-repair mode. |
10 | a_TableCheckInfo | output | no | array[tnTablesToCheck,5] |
Array with info for tables given to be checked. a_TableCheckInfo[n,1] - name of the table a_TableCheckInfo[n,2] - .t. if checked a_TableCheckInfo[n,3] - .t. if corrupted a_TableCheckInfo[n,4] - .t. if auto-repaired a_TableCheckInfo[n,5] - messages, if any. |
11 | tlAutoBackup | input output |
no | .f. | If to make backup copy of table files before repairing. In auot-repair mode here on output - if backup is really created. Backup name is same as original table name, with "-backup" added (before extension dot). |
HISTORY SINCE THE UTILITY IS PUBLISHED
Version | Date | Changes |
1995 |
|
|
1999 |
|
|
1999-07-09 |
|
|
2000-11-15 |
|
|
2002-12-08 |
|
|
2003a | 2003-11-28 |
|
2004a | 2004-06-19 |
|
2004b | 2004-07-28 |
|
2004c | 2004-08-27 |
|
2004d | 2004-12-13 |
|
2005a | 2005-07-04 |
|
2005b | in progress |
|