Article View: borland.public.cppbuilder.database.ado
Article #3865Re: It is too many slow...
From: M. Noroozi Eghbali
Date: Sun, 09 Jun 2002 12:20
Date: Sun, 09 Jun 2002 12:20
136 lines
6229 bytes
6229 bytes
Dear Vassiliev,
Thanks, the database filled faster than I could think about.
By the first way (changing the CursorType) the time decreased to 129 seconds
and by the OLEDBDirect it was only 10.736 seconds. Excellent.
Thanks again,
Mehrdad
"Vassiliev V.V." <news@vassilievvv.mtu-net.ru> wrote in message
news:3d03364b_1@dnews...
> Use server-side cursor and do NOT use batch updates - they are not
supported
> by Jet provider and Client Cursor Engine performs them very slow. You can
> also try OLEDB Direct at http://www.oledbdirect.com. OLEDB Direct is more
> difficult to use than ADO Express but it is much faster and powerfull.
>
> Demo for your case you can get at
> http://www.oledbdirect.com/downloads/Insert60000rows.zip. It inserts 60
000
> rows in Jet table with structure similar to yours in 50 seconds on PII-300
> 192 MB RAM computer - on your system it could be done in 10-15 seconds.
The
> database size is ~20 MB and requires no compacting (compare with results
you
> get with your code). Demo is for BCB5. To compile it you should download
> OLEDB Direct components and set include and lib paths in demo project. To
> run it - just press every button from top to bottom and wait result.
>
> If you will test this demo please send your times to
> support@oledbdirect.com.
>
> Regards,
> Vassiliev V.V.
> http://www.oledbdirect.com
>
> "M. Noroozi Eghbali" <galaxy@irandoc.ac.ir> �������/�������� � ��������
> ���������: news:3d021be7_2@dnews...
> > Hi,
> >
> > I am using an ADOTable and a DataSource (Microsoft.Jet.OLEDB.4.0) to
save
> my
> > database in an Access file. It has about 25 fields and none of them are
> > indexed. The number of records is about 60000. When I start the saving
to
> > the Access file, in the first second about 100 records were saved. The
> > saving speed gradually decreases inasmuch as after 15000 records the
> saving
> > speed reaches to maximum 1 record per second. I wrote the code of the
> saving
> > function here. please tell me what is the wrong.
> >
> > Regards,
> > Mehrdad
> >
> > void __fastcall TForm1::Save(TTreeNode *Node)
> > {
> > typedef CNodeData* PNodeData;
> > TTreeNode *ChildNode;
> >
> > do
> > {
> > DataModule1->ADOTable1->Append();
> > DataModule1->ADOTable1->FieldByName("Level")->AsInteger =
> > Node->Level;
> > DataModule1->ADOTable1->FieldByName("Term")->AsString =
> > Node->Text;
> > DataModule1->ADOTable1->FieldByName("BT")->AsString =
> > PNodeData(Node->Data)->BT;
> > DataModule1->ADOTable1->FieldByName("NT")->AsString =
> > PNodeData(Node->Data)->NT;
> > DataModule1->ADOTable1->FieldByName("RT")->AsString =
> > PNodeData(Node->Data)->RT;
> > DataModule1->ADOTable1->FieldByName("SN")->AsString =
> > PNodeData(Node->Data)->SN;
> > DataModule1->ADOTable1->FieldByName("UF")->AsString =
> > PNodeData(Node->Data)->UF;
> > DataModule1->ADOTable1->FieldByName("Translate1")->AsString =
> > PNodeData(Node->Data)->Translate1;
> > DataModule1->ADOTable1->FieldByName("Translate2")->AsString =
> > PNodeData(Node->Data)->Translate2;
> > DataModule1->ADOTable1->FieldByName("Translate3")->AsString =
> > PNodeData(Node->Data)->Translate3;
> > DataModule1->ADOTable1->FieldByName("Hide")->AsBoolean =
> > PNodeData(Node->Data)->Hide;
> > DataModule1->ADOTable1->FieldByName("Status")->AsInteger =
> > PNodeData(Node->Data)->Status;
> > DataModule1->ADOTable1->FieldByName("InputDate")->AsString =
> > PNodeData(Node->Data)->InputDate;
> > DataModule1->ADOTable1->FieldByName("ApprovalDate")->AsString
=
> > PNodeData(Node->Data)->ApprovalDate;
> > DataModule1->ADOTable1->FieldByName("LastUpdate")->AsString =
> > PNodeData(Node->Data)->LastUpdate;
> > DataModule1->ADOTable1->FieldByName("NotValidDate")->AsString
=
> > PNodeData(Node->Data)->NotValidDate;
> > DataModule1->ADOTable1->FieldByName("ABB")->AsString =
> > PNodeData(Node->Data)->ABB;
> > DataModule1->ADOTable1->FieldByName("SC")->AsString =
> > PNodeData(Node->Data)->SC;
> > DataModule1->ADOTable1->FieldByName("HN")->AsString =
> > PNodeData(Node->Data)->HN;
> > DataModule1->ADOTable1->FieldByName("SF")->AsString =
> > PNodeData(Node->Data)->SF;
> > DataModule1->ADOTable1->FieldByName("CA")->AsString =
> > PNodeData(Node->Data)->CA;
> > DataModule1->ADOTable1->FieldByName("EC")->AsString =
> > PNodeData(Node->Data)->EC;
> > if(PNodeData(Node->Data)->Frequency.IsEmpty())
> > DataModule1->ADOTable1->FieldByName("Frequency")->AsInteger =
> 0;
> > else
> > DataModule1->ADOTable1->FieldByName("Frequency")->AsInteger =
> > StrToInt(PNodeData(Node->Data)->Frequency);
> > DataModule1->ADOTable1->FieldByName("Description")->AsString =
> > PNodeData(Node->Data)->Description;
> >
> > DataModule1->ADOTable1->Post();
> >
> > ...
> > //Some codes to obtain next record from memory.
> > ...
> >
> > }while(Node);
> > }
> >
> >
>
>
>
>
Technical Details
Message-ID:
<3d0347cd_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsswitch.lcs.mit.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3d021be7_2@dnews> <3d03364b_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,856e9c01d3c42b29 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-09 05:25:02 PST From: "M. Noroozi Eghbali" <galaxy@irandoc.ac.ir> Newsgroups: borland.public.cppbuilder.database.ado References: <3d021be7_2@dnews> <3d03364b_1@dnews> Subject: Re: It is too many slow... Date: Sun, 9 Jun 2002 16:50:20 +0430 Lines: 138 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 213.176.21.5 Message-ID: <3d0347cd_1@dnews> X-Trace: dnews 1023625165 213.176.21.5 (9 Jun 2002 05:19:25 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsswitch.lcs.mit.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews