Whats the Fastest way to get a DBGrid to ListView?

eNarc
eNarc used Ask the Experts™
on
Hi, whats the fastest way of getting a DBGrid to ListView from a ADOConnection ADOQuery1 DataSource1

is there a way to skip the DBgrid all together and dive right into listview.

or is there a much more improved version of dbgrid that can act like a listviews neatness.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hi, the only way to load a listview is by code. Yes there are many different kinds of DBGrids, free or not. It depends what you whant to do. DBGrid is the most commonly used DB aware component when someone wants to show data from a DB...

This code will open the dataset, goto the first record and the go throught each record in the dataset (Next) until if reaches the End Of File (Eof). It then will close the dataset. This is the way to handle dataset's data...

procedure TForm1.Button1Click(Sender: TObject);
begin
 with ADOConnection.ADOQuery1 do
 begin
  Open;
  First;
  while not Eof do
   begin
    // Here write code to add data from dataset to the listview
    // You access fields from each record of the dataset by using
    //    FieldByName('my_field').AsString
    Next;
   end;
  Close;
 end;
end;

Author

Commented:
I got like 100,000 entries and it's taking forever to insert them,

I don't want to use dbgrid cos the scroll is weird, nothing like how we know in a folder or in a listview, is there any dbgrids like listview? Or a component that can use a datasource? that is like listview?
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Author

Commented:
I've tried that though

http://delphi.icm.edu.pl/ftp/d30free/dblvctl.zip

doesn't seem to comply within d2009.
Eddie ShipmanAll-around developer
Commented:
If you use BeginPaint before populating and EndPaint after populating, it should work faster. Otherwise, I'd suggest using TVirtualListview.
It is quite complex but will definitely do the job for you and even has example of doing what you are desiring.

Author

Commented:
dbgrid is slow, even with vlv and other listviews that can handle data, is also slow. its not as fast as the dbgrid, though the dbgrid is very hard to view and monitor.
Eddie ShipmanAll-around developer

Commented:
How many records are you loading? How many columns?

I've seen dbgrids and LVLs with 10's of thousands of records and not show any signs of being slow. Can you explain your situation a little better?

It way be that your data may need to be refined.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial