Article View: borland.public.cppbuilder.database.ado
Article #1240Re: CPU 100% when using TADOQuery
From: mymn
Date: Wed, 01 Sep 2004 03:06
Date: Wed, 01 Sep 2004 03:06
55 lines
2451 bytes
2451 bytes
hi sara,
sample to put Application->ProcessMessages( ) code....
while(!tempQuery->Eof)
{
k = k + 1;
TListItem *Item = frmStockConsumptionSearch->ListView1->Items->Add();
Item->Data =
(void*)tempQuery->FieldByName("IDStockConsumptionMain")->AsInteger;
Item->Caption = IntToStr(k);
Item->SubItems->Add(tempQuery->FieldByName("TransactionCode")->AsString);
Item->SubItems->Add(DateTimeToStr(tempQuery->FieldByName("TransactionDate")-
>AsDateTime));
Item->SubItems->Add(tempQuery->FieldByName("LocationCode")->AsString);
if (k%10==0)
Application->ProcessMessages();
tempQuery->Next();
}
delete tempQuery;
"Sara T." <sarana@infoquest.co.th> wrote in message
news:40511de1@newsgroups.borland.com...
> I am using following items:
> - Borland C++ Builder 6.0
> - Microsoft Windows 2000 Server SP4
> - Microsoft SQL 2000 Server SP3
> - MDAC 2.8
>
> I don't know where can I put Application->ProcessMessages() because I
> thought the method which make the CPU 100 % is ADOQuery->ExecSQL() because
> otherwise part of program is only set properties and value to variables.
>
> Any ideas ?
>
>
> "Dwayne" <myfrienddr@yahoo.com> wrote in message
> news:40507efe$1@newsgroups.borland.com...
> > Hello Sara,
> > When I use class TADOQuery to connect to retrieve or update in database,
> it
> > often eats memory and take a lot of cpu (around 90-100%) per times.
> >
> > Put in a Application->ProcessMessages();
> >
> > Dwayne
> >
> >
>
>
Technical Details
Message-ID:
<41353cb3@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:
<404fcc0a@newsgroups.borland.com> <40507efe$1@newsgroups.borland.com> <40511de1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,22a21529f5d43e51 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "mymn" <yusairi@yahoo.com> Newsgroups: borland.public.cppbuilder.database.ado References: <404fcc0a@newsgroups.borland.com> <40507efe$1@newsgroups.borland.com> <40511de1@newsgroups.borland.com> Subject: Re: CPU 100% when using TADOQuery Date: Wed, 1 Sep 2004 11:06:25 +0800 Lines: 57 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: 219.93.61.51 Message-ID: <41353cb3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094007987 219.93.61.51 (31 Aug 2004 20:06:27 -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