Page 1 of 1

TOraQuery AfterRefresh

Posted: Mon 05 Nov 2007 11:46
by polsol
Hi all,
I have a TOraQuery set to AutoCommitt and RefreshOptions set to roAfterInsert and roAfterUpdate.
I have some secondary processing set to the AfterRefresh event but the AfterRefresh Event doesn't fire on either an new record being entered or a record updated.
The AfterRefresh does, however, fire when a manual refresh is done.

Am I doing something wrong or is this a problem associated with AutoCommitt?

Regards,
Tony

Posted: Mon 05 Nov 2007 15:37
by Plash
After you insert or update a record, only the current record is refreshed using the RefreshRecord method of TOraQuery. But AfterRefresh event handler is called only when the whole dataset is refreshed using the Refresh method.

If you need to get an event when the RefreshRecord method is called, you can add a handler for AfterUpdateExecute event. In this event handler you should check StatementTypes parameter:

Code: Select all

  if stRefresh in StatementTypes then begin
    ...
  end;

Posted: Tue 06 Nov 2007 03:48
by polsol
Thanks for the info Plash. I don't think this is included in the on-line help so maybe it could be added for later versions?

Regards

Posted: Thu 08 Nov 2007 10:19
by Plash
We'll consider possibility to improve ODAC help.