OK, do a copy of the data dir to C:\databackup\ - That's mainly to be able to revert and restart repairing.
Then do another copy and call it C:\datarepair. Within the vRunFox command window change to that directory via
[tt]CD C:\datarepair[/tt]
Now enter [tt]MODIFY COMMAND[/tt] and an editor for "Program1" will appear.
Copy over this code:
Code:
For i=1 To ADir(laDBFs,"*.dbf")
Use laDBFs[i,1] Exclusive
Reindex
Endfor
Then Save that as reindexdir.prg into the C:\datarepair directory (The file menu will have the "Save As" menu item active when the editor is active).
Type in [tt]COMPILE reindexdir.prg[/tt] and if you look with Windows File Explorer, you'll see an FXP file will be created.
You can execute that now with [tt]DO reindexdir.fxp[/tt]
You'll see all CDX files will get new file dates, it can take a while, depending on DBF sizes.
It'll fail on CDXes, which are so corrupt, even their header has no good index information for the REINDEX command to be able to reconstruct them. If that's the case, older CDX files might help, as I initially explained. I hope this software has a backup feature or at least your company does backups, so you'd have older but intact CDX files, which now could be worth gold. The empty files from a new installation could also help.
I'm quite confident it'll help, but can't tell, what legacy formats of CDX files this might be. The repair could turn out worse than your original situation. Therefore I suggest leaving C:\databackup\ untouched. For the same reason and on top of that because some user might be in the system you better not repair the live data, too. It typically pays and saves a lot of network traffic to work on locally copied data. Of course, you have one roundtrip, but any working on the DBF and related files now done on local files is no payload on the network.
To test the repair you of course now will need to copy that back to the data directory of the shop system. You'll notice if someone is in the system, when some file has a current DateTime now, later than the files in C:\databackup\. Of course, that will mean copying back the repaired data is a step back in the data. So of course ideally you do all of this off hours.
Oh, and you see, that's a very short snippet. I don't charge for this.
I have downloaded the "Intro" version but didn't have the time to look at it so far. I'll install to look at the database it creates. I'll also see if it comes with source code, but I doubt that. Knowing the database will be helpful with any tasks about conversion. I assume you want to move your data to another shop system? Do you have regular index corruption? It might be due to an SMB file protocol feature called opportunistic locks. VFP doesn't cope well with them.
I'll get back to this on Monday. I'm in Germany, and to us, it's already far into the evening. Have a nice weekend!
Bye, Olaf.