Article View: borland.public.cppbuilder.database.ado
Article #1244Adoquery slow record retreval
From: William
Date: Fri, 03 Sep 2004 19:43
Date: Fri, 03 Sep 2004 19:43
30 lines
2237 bytes
2237 bytes
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:
<4138c989$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,7660a242b4ab7f8a,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "William" <wwestbrooks@houston.rr.com> From: "William" <wwestbrooks@houston.rr.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Adoquery slow record retreval Date: Fri, 3 Sep 2004 14:43:57 -0500 Lines: 32 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.186.72 Message-ID: <4138c989$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094240649 151.213.186.72 (3 Sep 2004 12:44:09 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail