#71 Locate(...) enters infinite loop

Win32_only
closed-invalid
Dbf File (25)
9
2012-11-12
2012-11-11
No

DBF version 6.9
TYPE: 7 (Visual dBase for Windows)
4 fields: NAMEUPPER C 30, INDEX C 1, OPTION C 30, VALUE LONGINTEGER
Index on first 2 fields, no primary key.
12 records in the table.
R, A, Option1, 1
R, B, Option2, 1
...
R, L, Option12, 1

OptionsDBF.Locate('NAMEUPPER;INDEX', VarArrayOf(['R', 'A'], []);

In DBF.pas, in LocateRecordLinear, Line 1805, 'while' loop. Never exits!\

The RecNo allways appears to be on number 12 and never continues.
I don't see a test for EOF.
However, the search should have found the record and returned.

Discussion

    • priority: 5 --> 9
     
  • Micha Nelissen
    Micha Nelissen
    2012-11-11

    How did you create that index? Was the index active during the Locate? Probably the index is either not compatible with TDbf (incompatible sorting order) or the index has become corrupt somehow.

     
    • status: open --> closed-invalid
     
  • Sorry. I created the DBF files and Indexes in Paradox for Windows.
    After I created a standalone applicaiton to create the tables and indexes step by step using tDBF, I was able to get it all functioning as required.