Subject Re: [IBO] Updates Fail in Cached Updates
Author yahoo@solarsys.co.uk
--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> At 03:17 PM 30-05-01 +0000, you wrote:
> >I am in the process of converting a Delphi 5 application from BDE
to
> >IBObjects and am getting an error when trying to update a dataset
> >using cached updates. The error is EDatabaseError with a message
of
> >'sUpdateFailed'. I believe I have the keylinks set appropriately
and
> >I have converted the sql so that the join is not in the where
clause.
> >The application appears to run very well apart from this so I am
> >guessing I have missed a step in the conversion process.
>
> Do you have either (a) a KeyRelation defined, to identify which
table is to be updated; or (b) an UpdateSQL statement for the cached
update; or (c) an EditSQL statement for the dataset ??
>
> Regards,
> Helen
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________


I have a ModifySQL statement for the cached update which I have
specified via a TIBOUpdateSQL object. While thinking about how to
explain more clearly what our application is doing I have resolved
the problem.

However:
1) I am not sure if my approach is as good as it could be.
and
2) I am not sure if I have removed all references to the BDE

Our application updates 2 or more joined tables using cached updates.
Each table is updated using a TIBOUpdateSQL object - one for each
table.

With the BDE version I set the DataSet property of each TUpdateSQL
object so that they all referenced the same TQuery.

With the IBObjects version the DataSet property is read only and so I
am assigning the TIBOUpdateSQL object to the TIBOQuery using the
UpdateObject property of the TIBOQuery. However in this case only one
TIBOUpdateSQL object can be assigned to the TIBOQuery.

My updates were failing because I had not appreciated this and only
one of my TIBOUpdateSQL objects was assigned to the TIBOQuery. To
work around this I am assigning each TIBOUpdateSQL objects to the
TIBOQuery at the point that I call SetParams and ExecSQL for that
TIBOUpdateSQL object. This works but perhaps there is a more elegant
way of achieving the same results with other IBObject components.

Lastly I would like to remove all references to the BDE but I am not
sure what references need to be removed from the uses clauses.

Any advice is appreciated.

Peter Taylor