Article View: borland.public.cppbuilder.database.ado
Article #1275Re: Slow performance with ADOQuery
From: Viatcheslav V. Vassiliev
Date: Thu, 09 Sep 2004 17:41
Date: Thu, 09 Sep 2004 17:41
62 lines
3149 bytes
3149 bytes
What is your DBMS? What is cursor type (server or client)? Is db server on
local computer or remote?
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Vic" <victor@espainformatica.com> �������/�������� � �������� ���������:
news:414078e5@newsgroups.borland.com...
> I have a problem with the TADOQuery. In my project I need to read records
> ( about 40000 ) from some tables and show them in a list. For do it, I use
a
> virtual TListview (OwnerData = true) and the ADOQuery with a SQL statement
> to read from database. The process for reading records from the database
to
> the query is fast, it gets about 3 sec., and I use the event OnData of the
> listview to show the records directly form the query.
> Here is the code :
>
> void __fastcall TForm1::ListView1Data(TObject *Sender, TListItem *Item)
> {
> ADOQuery->RecNo = Item->Index + 1;
>
> for ( int i = 0; i < ListView1->Columns->Count; i++ )
> {
> if ( i == 0 )
> Item->Caption = ADOQuery->FieldByName("CODIGO")->Value;
> else
>
> Item->SubItems->Add(ADOQuery->FieldByName("NOMBREFISCAL")->Value);
> }
> }
>
> Before show the records directly from the query, I tried to copy the query
> to my own list, and show the records from the list, but that process was
> very very very slow. Then I decide to avoid the 'QueryToMemory' process.
>
> The problem that I have now is when I scroll the listview. While at the
top
> of the listiew the scrolling is fast, when I go to
> the bottom of it the scrolling is much slower.
>
> I think that the problem should be here :
> ADOQuery->RecNo = Item->Index + 1;
> because if I comment this line, the scroll process returns to the normal
> performance, but ofcourse I can't comment this line.
>
> How can I solve that problem ?
> Is it any other faster way to do what I need ?
>
> Thank you in advance.
>
> Info : I'm using builder 6 and sqlserver 2000 in windows xp sp1.
> --
> Victor
> ESPA Inform�tica.
>
>
Technical Details
Message-ID:
<414095c6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<414078e5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,f914d51d26714f04 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <414078e5@newsgroups.borland.com> Subject: Re: Slow performance with ADOQuery Date: Thu, 9 Sep 2004 21:41:26 +0400 Lines: 64 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 213.234.218.42 Message-ID: <414095c6@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094751686 213.234.218.42 (9 Sep 2004 10:41:26 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail