Mega Code Archive

 
Categories / Delphi / ADO Database
 

Error index out of range with ttable findnearest or findkey

Question: Why do I get 'Index out of range' when I use TTable::FindNearest and TTable::FindKey on a dBASE table with an expression index? Answer: FindKey and FindNearest are not meant to work with dBASE expression indexes. Instead, use TTable::GoToKey and TTable::GotoNearest, which will work fine with dBASE expression indexes.