Can not get FetchAll (false) to work

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
DanyM
Posts: 3
Joined: Wed 20 Jan 2010 14:59

Can not get FetchAll (false) to work

Post by DanyM » Wed 20 Jan 2010 15:13

Hello!

I'm currently evaluating IBCDAC.
The master TIBCQuery on my form has FetchAll set to false. A TIBCDataSource is connected to the TIBCQuery and a DBGrid is connected to the DataSource.

When I open the dataset DBMonitor shows the execution to take 10 seconds and that is pretty consistent with fetching the whole table. Alas the DBGrid indicates that all records has been fetched. This also happens when I set the Active property to true in the IDE.

But when I click the "Data Editor..." button in the IBCQuery Editor the effect is that only 25 (the value of the FetchRows property) records are fetched until I scoll down beyond record number 25 when there is a small pause and the next 25 records are fetched. This is how I expect it to work in my application too.

What am I doing wrong?

TIA,

/Dany

DanyM
Posts: 3
Joined: Wed 20 Jan 2010 14:59

Can get FetchAll (false) to work

Post by DanyM » Fri 22 Jan 2010 19:25

I have discovered (by trial and error) that as soon as the property IndexFieldNames are filled the TIBCQuery behaves as though FethAll was set to true.

Either it happens on the first Open or on the first Open after the property has been set. dbMonitor also shows that the field(s) in the property are not propagated to the sever.

Subsequent changes of IndexFieldNames will be fast as long as everything is fetched, but other operations will trigger a "feth all" operation.

Is this really the intended behaviour of IBCDAC? In my mind it would be more prudent to reexecute the query using the orddering of IndexFieldNames and the do a fetches of the current record of those that an open DBGrid would need.

Is there any other way of presenting sorted datasets with IBCDAC?

Using IBCDAC 3.10.0.10 w D2010.

Regards,

/Dany

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 25 Jan 2010 08:38

IndexFieldNames is used to sort records locally. So all records are fetched. Use the OrderFields property to add ORDER BY to the statement and sort records on the server.

DanyM
Posts: 3
Joined: Wed 20 Jan 2010 14:59

Post by DanyM » Mon 25 Jan 2010 08:47

Thanks!

/D

Post Reply