>I'm trying to open a table in VFP (in the command window) and receiving an error:
>2091 - Table has become corrupted. The table will need to be repaired before using again.
>If I issue a set TableValidate To 0 command and try to open the table again, I receive a message "Memo file repaired. Proceeding" and the table is opened correctly.
>
>If I do the same in my application at run time, after issue a set TableValidate To 0 command, and try to open again, I receive an error:
>41 - Memo file is missing or is invalid.
>
>Why not working at run time?
You must use Set tablevalidate to 0 for one reason only, and that is to fix the table!
lnTablevalidate=Set("TableValidate")
Set tablevalidate to 0
use yourtable exclusive
pack memo
use
Set tablevalidate to lnTablevalidate