Subject Re: TBOQuery and TClientDataset bug?
Author Jackson Gomes
> The problem is, when I set the Active property to TRUE at runtime,
> I obtain an exception with the following message:
> "The qItemOnHand: field 'WarehouseID' not found"

I had the same problem and it seems a TIBOquery bug. I did the follow
in order to avoid the problem.

1. Select all fields from the table

>> Select *
>> From Itemwarehouse
>> Where ItemID = :ItemID
>> Group By ItemID

2. Add Persistent Fields for all fields

3. Change the FieldKind property to ftCalculated

4. Go back to your SQL and add your agregate function again

>> Select ItemID, SUM(Quantity) AS OnHand
>> From Itemwarehouse
>> Where ItemID = :ItemID
>> Group By ItemID

5. Add all fields again, but dont remove the fields added on step 2.

It seems TIBOQuery passes all fields to the ClientDataset, even if
they aren't in the Select clause.

It worked for me. I also needed to implement the IProviderSupport in
order to make it updateble. It seems TIBOQuery does not have such
interface.

Regards.

Jackson Gomes
Tools&Comps - Security Components for Borland Developers.
Web Site: http://www.toolsandcomps.com
Our Forum: http://groups.yahoo.com/group/toolsandcomps
e-mail: jackson@...
Phone: 55 27 99602760 / 55 27 33891138