Years ago, I built and maintained a VFP6 application for a client which had a large number of tables and records and there were a lot of memo fields used. Occasionally, something would get messed up with the memo fields (not necessarily hosed, but just issues with certain records) and I remember writing a simple script to scan through the records one by one and try to recover as many of the memo fields as possible. This is a decidedly low tech way of doing things and if a memo file is total corrupted this method will not save that file but it often would salvage 99.9% of the data if the corruption was minor.
The script doesn't change anything in the original dbf. It manually recreates the original as a file named "memofix" and the script depends upon adding the memofix table to your DBC in order to protect long file names, indexes, etc. Nothing jumped out at me as version 6 specific, but do your testing with backup copies of files if possible.
DISCLAIMER: I have not used this quick and dirty script since 2010: Use it at your own risk. Author makes no warranty this is useful in any way nor can I promise it will salvage anything for you. As usual, your mileage may vary. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ clear
set deleted off set safe off
use dbcontainer!master
if file('memofix.dbf')
REMOVE TABLE memofix DELETE endif
copy structure to memofix with cdx database dbcontainer use memofix in 0 excl
select master goto top
lnRecCnt = 1 lnRecTot = reccount('master')
scan
? transform(recno(),"@L 9999999") + transform(lnRecCnt/lnRecTot*100,"999.99%") append blank in memofix
for lnLoopCnt = 1 to fcount("master") lnWorkFld = field(lnLoopCnt,"master") replace memofix.&lnWorkfld with master.&lnWorkFld in memofix endfor
select master lnRecCnt = lnRecCnt + 1 endscan
use in master use in memofix set safe on set deleted on ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I can't remember if I got the idea from someone on one of the Foxpro forums or not, but I won't take credit for this just in case I did. It got us out of a couple of minor jams where we didn't have to restore data from backups and lose a day's worth of work.
If the script doesn't work, try this: http://www.dbf2002.com/dbf-recovery/. I use their DBF viewer on a regular basis and their products work well for me.
Hope it helps!
Paul H. Tarver Tarver Program Consultants, Inc.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Wednesday, November 01, 2017 6:28 PM To: profoxtech@leafe.com Subject: Fixing a hosed FPT file
How again do you fix this? I've got the FPT file size being significant, yet there are no notes in the memo field apparently. Obviously the pointers are screwed up somehow.
tia, --Mike
[excessive quoting removed by server]