CM Table Repair

Gallery with screenshots

Download last version

Order   Support

Check and repair utility for Visual FoxPro, FoxPro and other DBF-type tables. You can see and repair nearly all items in the header, structure and data of the table and memo files. It can be called from code to automatically repair bad headers or data.

It is well known, that if a FoxPro program (any version) appends/writes to a table and computer crashes, the table becomes bad. Next time when FoxPro uses it, an error appears, like this:

Not a database file (Error number 15)
Table "name" has become corrupted. The table will need to be repaired before using again. (Error number 2091)
MEMO file is missing/invalid (Error number 41)

For several years of working with large data massifs and many clients, 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 o­n disk in this order: first changes record number in the header of the table, and after changes the size of the file and writes data. Better way is to reverse order of this two operations, but it is embedded in the Foxpro engine.

During the years we added many more functionality to CM Table Repair, such as auto-repairing of errors when obtained, checking all tables in given folder, repairing tables over 2 Gb, backup and auto-backups, repairing memo file headers, examination of data in table checked at low level (that means independent from possibility of VFP to open the table), powerful Read/Write test with possibility to repair hidden errors in data, such as error 39 (numeric overflow) and 41 (invalid memo file addressing) and many more.

From version 2006b are added new action possibilities after ordinary and/or read/write table check: pack, reindex, zap, copy and export in different formats.


REQUIREMENTS

Application consists from o­ne run-time file: cmrepair.app. This is a Visual FoxPro application, so you need VFP installed o­n 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.

To use this software you need to purchase license, please see license conditions.


HISTORY SINCE THE UTILITY IS PUBLISHED
Version Date Changes
  1995
  • First Foxpro 2.6 versions.
  1999
  • First Visual Foxpro version (VFP 6).
  1999-07-09
  • Some interface changes and users suggestions.
  2000-11-15
  • bugs removed (no more errors in case of any file checking)
  • some long file name problems decided
  2002-12-08
  • Upgrading and support for VFP 7
2003a 2003-11-28
  • Added support for auto-incrementing in tables
  • Upgrading and support for VFP 8
  • Changes and improvements
2004a 2004-06-19
  • Added support for new data types
  • Upgrading and support for VFP 9
  • Removed limitation for number of records in advanced memo file analysis in case of running with VFP 9
2004b 2004-07-28
  • Auto-repair mode now repairs both record numbers and file size
  • Activity in auto-repair mode logs to a file with same folder and name as the utility, with .log extension
  • Introduced is new (third) calling parameter: number of risk records in auto-repair mode (defaults to 5)
2004c 2004-08-27
  • Auto-repair mode now repairs memo file headers in case of error 41 "memo file invalid" (next free block number and block size)
  • More precise handling of memo file checking process and offer to change memo file attributes
  • Checking given folder for corrupted tables, both manual and auto-repair mode
  • Introduced is new (fourth) calling parameter: path and name of log file for auto-repair activity
  • Introduced is new (fifth) calling parameter: silence mode (if .t.)
  • Introduced are new output parameters: info for performed work in auto-repair mode
  • Save and restore last directory where checking is performed (if not file or folder given as parameter)
  • Different style of starting: first screen appears, afterwards opening the table to check
  • Bugs are removed (refreshing in window "Memo file analyzing", appearing of the interface in auto-repair mode in case of not damaged table)
  • Improved documentation
2005a 2005-07-04
  • Introduced is possibility to fix the problem if repaired table exceeds 2 Gb (the Foxpro limit) and becomes corrupted (that happens for example when error 1190 "File is too large" is not triggered in VFP7 and below).
  • Removed dependence o­n foxtools.fll. If you are using old versions of VFP (<7), please set library to foxtools.fll in advance.
  • Support for all known Foxpro table types: DBF, FRX, LBX, DBC, SCX, VCX, MNX, PJX and respective memo files.
  • Auto-backup parameter and separate button (parameter is 11-th and defaults to .f.!)
  • All reported bugs to the moment are removed
  • More interface improvements
  • Stand alone EXE version (for registered users o­nly)
2005b 2005-12-09
  • Handling of error 13 (Alias is not found) when opening table in folder checking procedure. This error occurs if a table alias is used in index expression in CDX file, but not exist at that moment.
  • In case of folder checking all files with known table extensions are included in the process. The user can edit extensions list.
  • Procedure to read and show data from the table file is introduced. Reading is performed at low level, so it is independent from VFP possibility to open the table. For now we have 2 modes: "normal" - shows data with their data types, like in BROWSE window, and "raw" - you can see data from the file without any conversion, for example in Integer fields you see bytes, not digits, and in Memo type fields - bytes from memo block addresses. In both cases data are shown in columns, as specified in the table structure.
  • Read/Write test is introduced. This helps to find hidden errors in table data, such as numeric overflow and bad memo block addressing. This mode also have auto-repair possibility and o­ne more parameter is added: tlAutoCheckdata. Columns of output array a_TableCheckInfo are also increased to hold results from new RW test.
  • Example functions are extended for checking given folder in auto-repair mode with displaying the result, ad for RW test.
  • Improved help.
2006a 2006-03-21
  • Handling read-only files - when program attempts to open in read/write mode to change them, first attempts to reset read-only attribute to make file writable.
  • Added total size info for table checked (table + memo and index files).
  • Reporting - preview and/or print results from checking table or folder with tables. Report FRX files are included in the app.
  • Corrected are some errors in RW test procedure connected with field validation expressions and other small bugs. More testing and improvements.
  • 5-th parameter tlSilence is changed to numeric (.t./.f. accepted anyway) and if tnSilence > 1 user can see new reports without displaying the interface See this parameter description for all valid values.
2006b 2006-09-04
  • Added possibility to perform various service actions o­n tables: pack/reindex, reindex o­nly, zap, copy to folder, export as XLS, export delimited, export with tab.
  • This actions also have auto-possibilities and o­ne more parameter is added: tnAutoActTables. Columns of output array a_TableCheckInfo are also increased to hold results from new actions.
  • Added o­ne more parameter: tActParameters. For now it is used to define output folder in case tnAutoActTables is 4, 5, 6 or 7 (copy or export).
  • Provided is o­ne more example program example_1table_all.prg - haw to call cmrepair.app for o­ne table and after ordinary table check to test Read/Write, and also to perform given action (packing or other).
2007a 2007-11-20
  • Added possibility to run cmrepair.app in modeless mode (see additions to tnSilence parameter.
  • Added "Modify structure" possibility - sub-menu in "Use table" button.
  • Added new export format: simple HTML - data from the table are exported with no or minimum formatting.
  • More functionality in hole folder checking (all tables in it). Possibility to backup the folder. Interface changes - simplification, additions and more intuitive.
  • Preserve original filename and case in displaying results and creating files and folders.
  • VFP stand alone executable version is introduced - cmrepair.exe, requires VFP runtime libraries (for registered users o­nly - o­n request, compiled with VFP version 9 o­nly).
  • Added button for cleaning the folder (and all sub-folders) from files with extensions TMP, BAK or TBK.
2007b 2007-12-28
  • Resolved conflict when in table name are used special characters (not allowed in alias name).
  • Extended exporting capabilities:
    - in case tab or comma delimited export - replacing the delimiter in all character fields with space - because VFP do not care to do this in COPY TO command and exported file can be truncated at some points (where the delimiter is contained in the data).
    - before export with COPY TO command - creating an intermediate cursor with transformed memo columns of the table - to C*254 columns (this is because VFP can not export memo fields and neglects them).
  • Possibility to select which columns of the table to export, and also their order (their succession in destination file).
  • Added new export format: MySQL - data from the table are exported in a file with sql extension. This file contains valid SQL commands for creating the table in a MySQL database and also INSERT commands to import data. The file can be used in an MySQL database utility such as phpMyAdmin.
  • In addition to above MySQL format: php variant. An file with php extension is created. If this file is uploaded o­n the server and HTTP accessed - table and data are imported in given database. To specify database and connection parameters, it is obligatory to specify them in the beginning of the file (please see variables $sqlhost, $sqllogin, $sqlpass, $dbname and init them).
2008a 2008-04-24
  • Auto-repair mode now changes table flag in case the table is marked to have CDX file, but CDX file is missing. This permits table to be opened with success.
  • New possibility to pass as parameters table structure arrays (also indexes), in case table path is given, and new button and form with detailed comparison of given structure and real structure of checked table.
  • New possibility to use Windows API functions for low level file manipulation. This permits to check, repair and auto-repair tables even they are used from other users in the network in share mode. Now using API calls in CM Repair is default, but a parameter is provided if user like to force handling of files with Visual Foxpro low level file manipulation functions (see modified nAutoRepair parameter). In interface mode a checkbox is provided to control which functions to use.
2008b 2008-07-09
  • Introduced is database check. That means checking, testing and repairing DBC container and all tables in given database.
  • Auto-repair mode is extended over given database. See modification of 1-st calling parameter, and also calling example provided.
2009a 2009-05-09
  • Introduced is "Get healthy header" possibility. This procedure gets header from other table with exactly same structure and stuff it in the examined table file. To be used when data in the table file seems to be in line, but header is severe demaged.
  • Pack test is introduced. This helps to find hidden errors in table data, such as bad memo block addressing (error 41). This mode also have repair possibility. The procedure is especially useful when error 41 is reported when packing o­nly (not when open or read data in the table).
2010a 2010-08-11
  • A bug fix release:
  • Extensivelly tested with Visual Foxpro 6, 7, 8, 9 - proper usage of respective commands.
  • Siutable implementation in Windows 7 environment.
2012a 2012-02-13
  • A bug fix release
2016a 2016-02-19
  • Tested and adjusted to run in Windows 10
  • Intenzive testing and bug fixing in memo file analizis window.


To CM Utility Downloads Section

Download

Gallery with screenshots

CM Table Repair Utility - Screenshot 1