>Hey All
>
>We just ran a mass test on an application and we kept getting "Index file....\indvstats.cdx is corrupt, please rebuild index".
>
>My question is, what are the likely causes for this? We had, essentially, 20 machines banging on this file.
>
>The table in question has 4 fields, is indexed on one of them and has data being inserted into the table from this application
>
>The insert in question is:
>
> Insert Into indvstats (Scn, Idno, Resp, Key) ;
> Values (Alltrim(Str(StudentControlNum)), ReadTest.Idno, ;
> Iif(answer = 'A','1',Iif(answer = 'B', '2', Iif(answer = 'C','3','4'))),;
> Iif(ReadTest.Key = 'A','1',Iif(ReadTest.Key = 'B', '2',;
> iif(ReadTest.Key = 'C','3','4'))))
>
>
>Yes, this table is part of a container, but buffering is not turned on.
>
>Would someone be so kinds as to point me at all the other times this question has been answered, since I can't search?
Real-time antivirus scanning on workstations and/or server can potentially cause this. Test with real-time scanning temporarily disabled, or create exclusions for data and temp file folders so VFP files don't get scanned.
Some CDX file corruptions can't be fixed by REINDEX. REINDEX may make the index work for a while, but you'll shortly run into problems again. Instead, you have to either:
- DELETE TAG ALL on the table, and manually create the tag(s), or
- Overwrite the CDX file with a known good copy or backup, then REINDEX
I prefer the second method in case there is anything in a DBC that relies on index tags.
If problems persist after that, check data columns in the table for the presence of unexpected CHR( 0 )s. These usually appear as vertical black bars in a BROWSE.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up