Board index » delphi » ADO Slow or am I doing something wrong?

ADO Slow or am I doing something wrong?

Information:
Database: Oracle 8.1.7
OleDb Provider: Oracle Provider for OLEDB

The thing I want to create is to move data to a ClientDataSet and the
disconect from the database.

    ClientDataSet1.Close;
    ClientDataSet1.SetProvider(Query1);
    ClientDataSet1.Open;

When the Query1 is TADOQuery the SetProvider Function takes about 10 s for
10000 rows.
When Query1 is a TQuery with a BDE connection via ODBC it takes about 3 s
for 10000 rows.

Any ideas how i can make the ADO version faster? I dont want to use BDE and
the3 ODBC driver.

/Kristian Karlsson

 

Re:ADO Slow or am I doing something wrong?


Quote
"Kristian Karlsson" <k...@ps.sigma.se> wrote in message

news:3cb6a411_2@dnews...

Quote
> Any ideas how i can make the ADO version faster?

If using client-side cursors, call DisableControls in the AfterOpen of the
ADODataSet

Andy Mackie.

Re:ADO Slow or am I doing something wrong?


I have called the disablecontrol before the open. But that doesnt do any
thing hench
teh ADOQuery isnt connected to any thing...its the ClientDataSet1 that is
connected to the
grid. And that is completed after the SetProvider function.

The complete code snipet:

AdoQuery1.DisableControls;
ClientDataSet1.DisableControls;
ClientDataSet1.Close;
ClientDataSet1.SetProvider(AdoQuery1);
ClientDataSet1.Open;
AdoQuery1.Close;
AdoQuery1.EnableControls;
ClientDataSet1.EnableControls;

 dxDBGrid1.BeginUpdate;
 dxDBGrid1.DestroyColumns;
 dxDBGrid1.KeyField := '';
 DataSource1.DataSet:=ClientDataSet1;
dxDBGrid1.DataSource := DataSource1;
dxDBGrid1.CreateDefaultColumns(ClientDataSet1, dxDBGrid1);

dxDBGrid1.KeyField := 'RETDOOB_OBJ_ID';
dxDBGrid1.EndUpdate;

Quote
"Andy Mackie" <amac...@citynetworks.co.uk> wrote in message

news:3cb6d545$1_1@dnews...
Quote
> "Kristian Karlsson" <k...@ps.sigma.se> wrote in message
> news:3cb6a411_2@dnews...
> > Any ideas how i can make the ADO version faster?

> If using client-side cursors, call DisableControls in the AfterOpen of the
> ADODataSet

> Andy Mackie.

Re:ADO Slow or am I doing something wrong?


  If you're not updating the data via the TADOQuery, then you can set the
LockType property to ltReadOnly.  You might also be able to set the
CursorType property to ctOpenForwardOnly, but I'm not sure of that one when
using it to provide data to a ClientDataSet.  Those settings have made my
TADOQuery's MUCH faster!
-Howard

Re:ADO Slow or am I doing something wrong?


Does your SQL Query have any Sub SELECT statements for different fields. I
have seen this slow down my SQL Queries.

--

Peace in Christ,
Marco Napoli
http://www.ourlovingmother.org

Quote
"Kristian Karlsson" <k...@ps.sigma.se> wrote in message

news:3cb6a411_2@dnews...
Quote
> Information:
> Database: Oracle 8.1.7
> OleDb Provider: Oracle Provider for OLEDB

> The thing I want to create is to move data to a ClientDataSet and the
> disconect from the database.

>     ClientDataSet1.Close;
>     ClientDataSet1.SetProvider(Query1);
>     ClientDataSet1.Open;

> When the Query1 is TADOQuery the SetProvider Function takes about 10 s for
> 10000 rows.
> When Query1 is a TQuery with a BDE connection via ODBC it takes about 3 s
> for 10000 rows.

> Any ideas how i can make the ADO version faster? I dont want to use BDE
and
> the3 ODBC driver.

> /Kristian Karlsson

Re:ADO Slow or am I doing something wrong?


oledb direct www.oledbdirect.com is faster than ADO as it goes directly to
the oledb layer and skips ado. Apparently the VCL wrapper for ADO is
significantly slower than the MS ADO.

HTH,

Lauchlan M.

Other Threads