In FoxPro tables, each .dbf file can have a matching .cdx (or
maybe
a .idx) file for its index(es). The corruption or invalidity
would
be related to that file.
If it's a FoxPro table, and the index is "corrupted", it might
be
because:
- Maybe the index expression is too long or has a typing mistake
in it.
- Maybe there are too many indexes attached to the physical
.dbf file,
so the .cdx or .idx file becomes too large or too
complex.
- Sometimes, an index gets "corrupted" during run-time and nobody
knows
why. So if I go into FoxPro and say on FoxPro
command line:
use table_name exclusive
reindex
close
quit
That usually fixes the "corruption".
If it's a FoxPro table, and the index is "invalid", it might be because:
- Maybe the field you pick as your "index field" for the Delphi
Ttable
is not a key field or not a primary index field
in the physical
database. You might need to go to FoxPro command
line and create an
index that starts with the field(s) you want to
use for indexing:
use table_name exclusive
index field_name tag index_name
reindex
close
If you want to have more than one field
in your new index, change
the 2nd line to plural like this (you
can have + more than 2
fields):
index 1st_field_name+2nd_field_name tag index_name