Subject | Go straight to the nth record on a query's queue |
---|---|
Author | Roberto Freitas |
Post date | 2006-07-05T13:47:40Z |
I use Delphi 7, FireBird 1.5 and IBO4.
Suppose a form containing:
qrTable: TIB_Query;
dsData: TIB_DataSource;
qrTable.SQL.Text := SELECT * FROM ATABLE WHERE SOMECONDITION;
Opening qrTable returns 30000 records. I dont't know actual physical
places of these records in DataBase, but I can virtually imagine them
one after the other in a big queue with 30000 elements.
After opening the form, it quickly shows first record on screen. If I
want to show the queue's element 20001 - which primary key value I
don't know - the program does:
with qrTable do begin
DisableControls;
MoveBy(20000);
EnableControls;
end;
It wastes some time to do it: a "loading records" panel appear.
My question is: is there any DataBase command or an IBO resource that
make possible to go straight to the 20001th record ?
(Please, good or bad programming techniques is not the subject here,
because everything I write above is not real, but just a way to
explain what I need, which is a way to go straight to the nth record
on a query's queue when I don't know it's primary key value)
Suppose a form containing:
qrTable: TIB_Query;
dsData: TIB_DataSource;
qrTable.SQL.Text := SELECT * FROM ATABLE WHERE SOMECONDITION;
Opening qrTable returns 30000 records. I dont't know actual physical
places of these records in DataBase, but I can virtually imagine them
one after the other in a big queue with 30000 elements.
After opening the form, it quickly shows first record on screen. If I
want to show the queue's element 20001 - which primary key value I
don't know - the program does:
with qrTable do begin
DisableControls;
MoveBy(20000);
EnableControls;
end;
It wastes some time to do it: a "loading records" panel appear.
My question is: is there any DataBase command or an IBO resource that
make possible to go straight to the 20001th record ?
(Please, good or bad programming techniques is not the subject here,
because everything I write above is not real, but just a way to
explain what I need, which is a way to go straight to the nth record
on a query's queue when I don't know it's primary key value)