Article View: borland.public.cppbuilder.database.ado
Article #1267Writing Multiple Records Slow
From: William
Date: Tue, 07 Sep 2004 17:16
Date: Tue, 07 Sep 2004 17:16
20 lines
1956 bytes
1956 bytes
Hi
I am using an TADOQuery component to open a table in an MS Access
database and write about 150,000 new records to the table. The code I use is
below and it takes too long to write all the records to the database about 5
minutes. The Append() and Post() functions seems to cause the bottle neck
whenever that line of code is commented out . How can I fix my code so that
the records will be written to the database in an acceptable time limit.
C1 = CustLoc.begin();
while(C1! = CustLoc.end()) {
ADOQuery2->Append();
ADOQuery2->FieldValues["ServiceID"] = E1->first;
ADOQuery2->FieldValues["X"] = C1->second.X;
ADOQuery2->FieldValues["Y"] = C1->second.Y;
ADOQuery2->FieldValues["NodeID"] =
C1->second.NodeID;
ADOQuery2->FieldValues["LegID"] = C1->second.LegID;
ADOQuery2->Post();
++C1;
}
Technical Details
Message-ID:
<413ded14$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,12e770b67fbee4b4,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: Writing Multiple Records Slow Date: Tue, 7 Sep 2004 12:16:56 -0500 Lines: 22 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: <413ded14$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094577428 151.213.180.193 (7 Sep 2004 10:17:08 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail