Article View: borland.public.cppbuilder.database.ado
Article #1795Re: Speed with ADO
From: Viatcheslav V. Vassiliev
Date: Wed, 28 Jan 2004 14:44
Date: Wed, 28 Jan 2004 14:44
58 lines
3098 bytes
3098 bytes
VCL sets some properties when it creates TADODataSet. When you assign new recordset with ADOrset->Recordset = ADOcommand->Execute(); the internal recordset in TADODataSet is replaced, TADODataSet retrieves fields definitions, creates fields (TField objects), moves to the first record, does some other processing. VB works with ADO recordset directly. So just opening dataset may be a little slower. ADO itself is VB oriented and BCB can not use ADO much more efficient than VB. However BCB can access lower level - OLEDB - this level is used by ADO internally. OLEDB will be faster (sometimes very much faster) and will let to use some hidden from ADO features that OLEDB provider may have, but OLEDB is more difficult to use than ADO. //------------------------------------------ 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) "avix" <avix@avix.com> �������/�������� � �������� ���������: news:bv86qd$p6060$1@ID-202260.news.uni-berlin.de... > Hello, > > I'm writting several DB access routines with ADO and i started to write them > in Visual Basic, they worked fine. Now i'm 'transalting' those routines to > Builder and i'm very surprised because they work slower than in VB. What in > vb takes aprox. 500 ms in BCB takes almost 800 ms. > > I'm creating TADOCommand and TADODataSet inside the code (with new, not > using controls) . The most important time cost is when the command is > executed and the recordset is created (the sentences between the '>>>>>>' > marks): > > TADOCommand *ADOcommand = new TADOCommand(Application); > ADOcommand->Connection = ADOconnection; > ADOcommand->CommandType = cmdText; > ADOcommand->CommandText = txtSQL; > > >>>> > TADODataSet *ADOrset = new TADODataSet(Application); > ADOrset->Recordset = ADOcommand->Execute(); > >>>> > > Do you know any tricks for speeding up my code? > Am i doing somethig wrong? > > Thank you in advance. > > Avix > >
Technical Details
Message-ID:
<4017cad5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<bv86qd$p6060$1@ID-202260.news.uni-berlin.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,b8117718debae563 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-01-28 07:10:37 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <bv86qd$p6060$1@ID-202260.news.uni-berlin.de> Subject: Re: Speed with ADO Date: Wed, 28 Jan 2004 17:44:35 +0300 Lines: 60 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 213.234.218.42 Message-ID: <4017cad5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075301077 213.234.218.42 (28 Jan 2004 06:44:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail