Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: How to use TADUpdateSQL?
How to use TADUpdateSQL?
Posted: 2007/06/18 12:19
 
Hi,

I am about to porting a project from BDE to AnyDAC.
With BDE I used for instance TUpateSQL(ukModify). Now I have to deal with TADUpdateSQL and don't know what to put as second and third parameter.
As first parameter I write 'arUpdate' - that's easy.
For the third I put

 TADPhysUpdateRowOptions() << uoImmediateUpd

is that a good idea? And what is about the second parameter? Is that an error handler?

** edit **
I found out: No error handler but an error condition (right?).

 enum TADErrorAction eaFaileaSkipeaRetryeaAppliedeaDefaulteaExitSuccesseaExitFailure };

New question: What's the difference in behaviour between (for instance) eaFail and eaExitFailure? And - because it's passed by reference - what comes back?

Regards knulo

Post edited by: knulo, at: 2007/06/21 08:31
Re:How to use TADUpdateSQL?
Posted: 2007/06/22 05:16
 
Hello

1) In general, ADUpdateSQL.Apply method is intented to be called from ADQuery.OnUpdateRecord event handler. There is the demo AnyDAC|DEMO|Comp Layer|TADUpdateSQL|Main. As you can see there in qrProductsUpdateRecord event handler, Apply method is called with parameter values received in event handler. If you going to call Apply method outside of OnUpdateRecord event handler, then give me details of what you are doing.

2) ARequest - what we going to do with row. AAction - what the code called event handler should do after event handler is finished:
- eaFail - failed. Stop processing changes and throw exception.
- eaSkip - skip current row.
- eaRetry - try again.
- eaApplied - changes applied successfully.
- eaDefault - take your default action.
- eaExitSuccess - similar to eaApplied. Has only internal meaning. Dont use.
- eaExitFailure - similar to eaFail. Has only internal meaning. Dont use.

Regards,
Dmitry