I had a Delphi 4 program that I developed many years ago that used Opus DirectAccess to sequentially search through a Microsoft Access database and retrieve desired records. Delphi 4 did not have ADO, so that's why I was using DirectAccess.
But I've now upgraded to Delphi 2009 and converted the program to use ADO. What I found was that the loop through the table (of some 100,000 records) starts off as fast as it did in DirectAccess, but then it starts slowing down and gets slower and slower as it goes through the table. The basic loop is:
ArticlesTable.First;
while not Cancel and not ArticlesTable.Eof do begin
( See if the current record has criteria desired )
( If so, process the record )
ArticlesTable.Next;
end;
So basically, it is just processing the records sequentially using the .Next method.
So why is it slowing down, and how can I recode this so that it won't slow down?