Friday, June 10, 2011

How to resolve Error-2091 in Foxpro 9.0

Do you got this error message when you try to insert a new record in a table or in any other situation:

"Table ..has become corrupted.The table will need to be repaired before
using again." (error-2091)


Possible cause of this error: 

  • This error usually appear after a certain table was accidentally corrupted due to power failure or improper system shutdown.
  • The actual records in the table does not match the table record count.
  • The file size on the disk does not match the expected file size from the table header.


Perform these actions to resolve this issue:


1. First you need to create an environment under which the table is NOT validated when it is opened. This can be achieved by the command -SET TABLEVALIDATE TO 0. Now you can easily open your tables. If it is not work go to second solution.


2. Second solution is to repair corrupt table by using an appropriate third-party DBF repair software for Visual FoxPro tables before opening the table again.


These are some “Prevention Steps” to prevent your data from corruption:
  • Try to put a code in your program that automatically creates a duplicate copy of your tables (columns & rows), index files and databases.
  • Set-up a back-up routine.
  • Inform the user to properly shutdown the computer and regularly perform back-up.
  • Use UPS for power back-up.

These are some common steps which every single user knows, but not applied in real life so applied these steps to prevent your data from corruption.

0 comments:

Post a Comment