×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to retrieve multi selection fast?

How to retrieve multi selection fast?

How to retrieve multi selection fast?

(OP)
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?

RE: How to retrieve multi selection fast?

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
http://www.upscene.com

RE: How to retrieve multi selection fast?

(OP)
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.

RE: How to retrieve multi selection fast?

> Is there a way to get the selected rows directly without traversing the buffer

Better ask at the IBO list then - see www.ibobjects.com for details.

Martijn Tonies
Database Workbench - the developer tool for InterBase and Firebird
http://www.upscene.com

RE: How to retrieve multi selection fast?

(OP)
ok i'll do that thanx for your reply

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close