Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record is not in index (Error 20) Cause?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01687574
Message ID:
01687581
Views:
50
>>>Hi all -
>>>
>>>I don't think I've ever experienced this error in any of the apps I've been involved with. Currently working on a very old VFP app running under VFP 8.0 (Version 08.00.0000.2521) and encountering this error when a PRG attempts a COPY TO (lcRptFile) FIELDS &lcFldList. TYPE CSV command.
>>>
>>>- This code runs all the time; not sure why this particular import is triggering the issue.
>>>- The table in the current work area is created by the same PRG, and the index is a CDX (so makes it harder to understand how data may have changed in the DBF row but the index is not updated).
>>>- If I suspend, then retry the command, it works! (So I can introduce code to catch the error and retry. Obviously.)
>>>- This "feels" like a buffering / latency problem to me.
>>>
>>>Clearly we're missing at least one SP for VFP 8, and it could be that or VFP 9.0 would not throw this error. That said, upgrading VFP is not an option at this time.
>>>
>>>Any thoughts?
>>>
>>>TIA!
>>

I've conducted further debugging to address the issue, and I want to share some additional information. In brief, the problem was resolved by introducing a REINDEX command, eliminating the occurrence of ERROR 20 (Record is not in index).

Here are key details:

1.) The cause of the index becoming corrupted or out of sync with table data remains unknown.

2.) The table is created just a few lines earlier, and the index is a CDX index tag. As far as I know, CDXs are typically maintained automatically.

3.) Despite the Error 20 being thrown, the output CSV was generated, and several thousand rows were successfully written to the file. Presumably the issue arose when FoxPro encountered the record with the corrupted index entry.

4.) Upon inspecting the rows in the output CSV (both the shortened version before implementing REINDEX and the full one created after adding REINDEX), I haven't identified any anomalous data that would explain the occurrence of the problem.

5.) I still need to examine the source table's data, but I'm currently running a test, so access to the data is temporarily unavailable.

I hope this provides a clearer picture of the situation. If you have any insights or suggestions, please feel free to share.

Thanks again!
________________
_____/ Regards,
____/ al

___________________________________________
www.jcn-associates.com
Visual FoxPro Database Application Development and IT Project Management
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform