Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index (cdx) becoming corrupt

Status
Not open for further replies.

Kflasph

Programmer
Apr 8, 2002
65
US
My company currently runs both Visual FoxPro(6) and Dos Foxpro. We have many tables that are used (updated,read,etc) in both formats with no problems. I have a table that is zapped every night and rebuilt using DOS that I have to replace information in. I wrote a program in Visual to do this.

Now -- here is the problem -- After I run my visual program and do a replace on one of the fields in the table( a 10 character replacement from a 10 character field) and I run a program in DOS that uses the file, one of the tags the DOS program uses becomes corrupt. It happens only after I run the DOS program that uses the index of this table.

I can run the same replace program in DOS and this does not happen - the program runs all day long with no corrupt index. It only happens after I run the Visual program to do the update of the field.

I have run FOXFIX, reindexed in Visual and DOS, rebuilt the table and the index manually and appended from the original table in Visual and DOS,and blown away the cdx completely.

What am I missing? What can I do to resolve this besides running my replace program in DOS? How can I fix my cdx?

Thanks in advance,
Kflasph
 
It seems VFP and FPD aren't handling the indexes the same way. I do know that VFP has several field data types that are unknown to FPD so perhaps it is doing something differently that FPD can't handle. Maybe it's the ZAP that is creating a new copy of the index. Have you tried deleting all the records and then PACKing the table rather than ZAP to see if that avoids the problem?

Unless someone else has a better suggestion, and I hope someone does suggest one, try deleting the tags and rebuilding them from scratch in FPD as shown in my code here in thread184-739063. Yes, it's a real hassle, but if you have a known issue and no simple fix, this should take care of it.
 
Structures and index tags are forward compatible, but not backwards compatible. What this means is anything you create or change in the DOS version can be read by VFP, but not the other way around.

If you can't run the routine that recreates the index tags in the DOS version, then create them in VFP, but to a temporary file. Then use COPY TO RealFile WITH CDX TYPE FOX2X to create backwards compatible files.


-BP (Barbara Peisch)
 
Thanks for the ideas but apparently what BPeisch states in OH so true. I tried both suggestions but still had the same results when the programs ran. I ended up rewriting something in DOS to do the job.

Thanks again for the tips!
KFlasph

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top