Wednesday, August 3, 2016

FoxPro: Table '' has become corrupted. The table will need to be repaired before using again.

I came across this error while trying to run an old foxpro application to analyse and understand some functionality which i need to replication in an new application that am working on.

Quick google search helped me fix it fast, might not be the appropriate way but it gave me a swift go towards my goal.
Am using VFP 9.0 IDE, so follow and type these commands in your command window


  1. CD to the path location to the corrupt table.
  2. SET TABLEVALIDATE TO 0 && this disables table validate for the current session
  3. USE size && open, select the corrupt table
  4. COPY STRUCTURE TO size1 && copy table structure to a new temp table
  5. USE size1 && select, open up the temp table
  6. APPEND FROM size && append all the data from the corrupt table to the new table



That is it, delete the old corrupt table and then rename the new temp table with the desired table name because it has all the old table data.

Hope it help, happy coding ;)