Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve multi selection fast?

Status
Not open for further replies.

ROBLEMMENS

Programmer
Feb 20, 2003
12
SE
I'm using IB_Grids, the only way i know to get all selected rows is to loop the buffer and check if a row is selected, like this:

q.BufferFirst;
While not q.BufferEOF do begin
if q.Selected[q.BufferRowNum] then begin
if(WhatInList = COL_NUMBERS) then
sl.Add(IntToStr(q.BufferFields.Values['COL_NR']))
else if(WhatInList = DOC_NUMBERS) then
sl.Add(IntToStr(q.BufferFields.Values['DOC_NR']));
end;
q.BufferNext;
end;

This works fine for small tables but for a table with 200000 rows this method is really slow. Is there a way to get the selected rows directly without traversing the buffer?
 
Why do you have a grid (display to user?!) with 200000 rows?! Would he MANUALLY select a couple of rows? Poor customer...

Martijn Tonies
Database Workbench - the developer tool for InterBase and Firebird
 
In the main window there is a list with all documents in the program, at startup the list is loaded in the grid and the newest documents are on top. The users want to be able to scroll trough the entire list, select the records they want and then do something with that. When a user performs an additional search action the results are also shown in this grid and then the list is usually small enough for a fast traversel of the buffer. But they just wont use a search action because they think that it is faster to browse trough the complete list, very inefficient i know but i dont have another choice then to display the full list.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top