>Can anybody suggest how to overcome the following problem
>with Visual FoxPro 6.0:
>
>We have relativly big table (in database container):
>approximately 100 MB DBF part of it and 25 MB CDX part.
>The table is heavyly used in network encironment
>(Windows NT 4.0 or Novell Netware 4.11)
>from 25-30 workstations, and most users add records.
>Form is using private data session, multilocks is set to ON,
>buffering is set to table optymistic (5).
>
>Sometimes it happens that record is added to table (it is
>in DBF file), but there is no entry in CDX file.
>Unfortunatelly in this case TABLEUPDATE returns TRUE,
>so we issue END TRANSACTION and in the result index is corruped.
>Reindex clears the problem, but that is not a solution.
>
I've seen this problem occur when a CDX was created as a non-structural CDX accidentally - the CDX got created when you did an INDEX ON
expression TAG
tagname OF
CDXFile, which doesn't automatically get opened with the table (a structural CDX opens automatically with the table. The only way I know how to fix the problem in this situation is to rebuild the CDX as a structural CDX - open the table with the non-structural CDX in effect, do a DELETE TAG ALL, and then rebuild the CDX by issuing individual INDEX ON
expression TAG
tagname statements, being certain not to use the OF clause. REINDEX doesn't help, and as I remeber, the CDX file has to be deleted and built from scratch.
FWIW, the only time I use a non-structural CDX is when building temporary indexes on cursors; a CDX uses only one file handle for all its tags, where each index created with an INDEX ON ... TO uses a separate file handle, and you can create a non-structural CDX without having to make a cursor writable.