Article View: borland.public.cppbuilder.database.ado
Article #3798Re: Faster way to just add a record
From: Yuancai (charlie) Ye
Date: Mon, 24 Jun 2002 15:20
Date: Mon, 24 Jun 2002 15:20
38 lines
2259 bytes
2259 bytes
Hi,
It is faster to use a prepared parameterized statement for fast
loading data into a data source. Send multiple sets of parameters instead of
one-by-one. See the samples OleDBExcel and MultiProcs at www.udaparts.com.
If your backend is SQL server, you could use IRowsetFastLoad. See the sample
FastLoad.
--
Yuancai (Charlie) Ye
Use of free SocketPro package for creating super client and server
application,
See 30 well-tested and real OLEDB examples
at http://www.udaparts.com
"Christian Schneider" <csname@hotmail.com> wrote in message
news:3d16bf57$1_1@dnews...
>
> I just want to add a record to a table. I am now
> using something like this:
>
> AdoDataSet->CommandText = "SELECT * FROM Customer";
> AdoDataSet->Open();
> AdoDataSet->Insert();
> AdoDataSet->FieldByName(...) = ...
> AdoDataSet->Post();
> AdoDataSet->Close();
>
> The problem is, that Open() can take very long if the
> table is large. It would be much faster to use an
> "INSERT INTO"-Statement, but I can't use it because
> my record contains BLOB-Fields.
>
> It there really no other way to just add
> a record to a table without waiting several seconds?
>
>
> Christian Schneider
Technical Details
Message-ID:
<3d173892_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!yellow.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news-out.newsfeeds.com!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3d16bf57$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,245e9e27193aa62b X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-24 08:27:54 PST Reply-To: "Yuancai \(charlie\) Ye" <yekerui@yahoo.com> From: "Yuancai \(charlie\) Ye" <yekerui@yahoo.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3d16bf57$1_1@dnews> Subject: Re: Faster way to just add a record Date: Mon, 24 Jun 2002 11:20:42 -0400 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 NNTP-Posting-Host: 12.92.214.138 Message-ID: <3d173892_1@dnews> X-Trace: dnews 1024931986 12.92.214.138 (24 Jun 2002 08:19:46 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!yellow.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news-out.newsfeeds.com!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews