🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1262

Re: Adoquery slow record retreval

#1262
From: William
Date: Tue, 07 Sep 2004 14:37
75 lines
3821 bytes
Can you give me a code example of how to Directly fetch records directly
into CustLocaTableRec record, without convertion of db value into Variant
and back to record field type.


"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:41396b4f@newsgroups.borland.com...
> 1. Use server-side cursor (CursorLocation = crUseServer).
> 2. Do not use FindFirst(), use First().
> 3. Do not use RecordCount - use:
>
>   while (!ADOQuery1->Eof)
>   {
>     ...
>     ADOQuery1->Next();
>   }
>
> 4. Call DisableControls()/EnableControls() even if there are no controls
> attached.
>
> BTW, with OLEDB Direct you will be able to fetch records directly into
> CustLocaTableRec record, without convertion of db value into Variant and
> back to record field type.
>
> //------------------------------------------
> 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)
>
> "William" <wwestbrooks@houston.rr.com> �������/�������� � ��������
> ���������: news:4138c989$1@newsgroups.borland.com...
> > Hi
> >
> >     I am using a TADOQuery component to access a local MS Access
database
> > table on my machine. The problem is the time it takes to read all the
> > records in the table is unacceptably slow. I have about 160,000 records
in
> > the table and I read in each records information. If I comment out all
the
> > code in my loop and only leave the statement ADOQuery1->Next(), this is
> the
> > bottle neck it takes about five minutes to retrieve all the records. I
> tried
> > setting the CacheSize property to 10,000 but it didn't speed up the
> > application. How can I optimize accessing the data, to make it
expectable.
> > My code is below.
> >
> > // Go to the first record
> >         ADOQuery1->FindFirst();
> >         for(i1=0;i1<ADOQuery1->RecordCount;++i1) {
> >             // Catch conversion errors
> >          try {
> >                 CustLocTableRec.X = ADOQuery1->FieldValues["X"];
> >                 CustLocTableRec.Y = ADOQuery1->FieldValues["Y"];
> >                 CustLocTableRec.NodeID =
ADOQuery1->FieldValues["NodeID"];
> >                 CustLocTableRec.LegID = ADOQuery1->FieldValues["LegID"];
> >             } catch(...) {
> >                 LOGWARNINGS = true;
> >                 break;
> >              }
> >             CustLocTableRec.Used = false;
> >             CustLocTable[ADOQuery1->FieldValues["ServiceID"]] =
> > CustLocTableRec;
> >             ADOQuery1->Next(); // Bottle neck
> >      }
> >
> >
>
>
Technical Details
Message-ID: <413dc7bd$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4138c989$1@newsgroups.borland.com> <41396b4f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,7660a242b4ab7f8a
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "William" <wwestbrooks@houston.rr.com>
From: "William" <wwestbrooks@houston.rr.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4138c989$1@newsgroups.borland.com> <41396b4f@newsgroups.borland.com>
Subject: Re: Adoquery slow record retreval
Date: Tue, 7 Sep 2004 09:37:33 -0500
Lines: 77
Organization: William Inc.
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: 151.213.180.193
Message-ID: <413dc7bd$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1094567869 151.213.180.193 (7 Sep 2004 07:37:49 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail