🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Writing Multiple Records Slow

#1271
From: Viatcheslav V. Vassiliev
Date: Wed, 08 Sep 2004 16:33
83 lines
4409 bytes
It is an example for OLEDB Direct (http://www.oledbdirect.com) components.
In then directory where OLEDB Direct is installed (by default, C:\Program
Files\OLEDBDirect) you could find subdirectory Examples, then subdirectory
Tutorial and at last subdirectory Step6 - Transaction. Example is there.

//------------------------------------------
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:413f18a6@newsgroups.borland.com...
> 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: <413f3443@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-mail
References: <413ded14$1@newsgroups.borland.com> <413ebeda$1@newsgroups.borland.com> <413f18a6@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,12e770b67fbee4b4
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <413ded14$1@newsgroups.borland.com> <413ebeda$1@newsgroups.borland.com> <413f18a6@newsgroups.borland.com>
Subject: Re: Writing Multiple Records Slow
Date: Wed, 8 Sep 2004 20:33:08 +0400
Lines: 85
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: 213.234.218.42
Message-ID: <413f3443@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1094661187 213.234.218.42 (8 Sep 2004 09:33:07 -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