🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Writing Multiple Records Slow

#1270
From: William
Date: Wed, 08 Sep 2004 14:35
60 lines
3633 bytes
Can you give me the web address to "Examples\Tutorial\Step6 - Transaction. I
am having trouble finding it. thanks

"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:413ebeda$1@newsgroups.borland.com...
> Do you have strings in CustLoc? If yes, try to use ADO recordset directly,
> without TADODataSet/TADOQuery/TADOTable. Try also execute all this code in
> transaction - this may speedup your code ~2x, but requires enough RAM.
> Instead of FieldValues["FieldName"] try to use Fields->Fields[X], where X
is
> integer. Calling DisableControls()/EnableControls() even if no controls
> attached could help. If you create table before doing inserts, create
> indeces after inserts.
>
> In OLEDB Direct, you may look at example in "Examples\Tutorial\Step6 -
> Transaction" - there is inserts 200 000 records (100 000 without
transaction
> and 100 000 with transaction). This takes 12 sec. on modern computer.
>
> //------------------------------------------
> 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:413ded14$1@newsgroups.borland.com...
> > 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: <413f18a6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <413ded14$1@newsgroups.borland.com> <413ebeda$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,12e770b67fbee4b4
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: <413ded14$1@newsgroups.borland.com> <413ebeda$1@newsgroups.borland.com>
Subject: Re: Writing Multiple Records Slow
Date: Wed, 8 Sep 2004 09:35:06 -0500
Lines: 62
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: <413f18a6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1094654118 151.213.180.193 (8 Sep 2004 07:35:18 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail