PowerBuilder 11.5 adds two new events for the Transaction object, DBError and SQLPreview. These events have slightly different signatures than the DBError and SQLPreview events on the DataWindow control and DataStore, but their behavior is similar.
For event signature information, see the online Help for the Transaction object and DataWindow control DBError and SQLPreview events.
By default, whenever an error occurs in the Transaction object, the DBError event is called. The error code and error message are passed to this event. You can add code to the DBError event to handle these errors. The SQLPreview event on the Transaction object is triggered before SQL statements are passed to the DBMS.
DBError When using a Transaction object with a DataWindow or DataStore, the DataWindow DBError event is triggered before the DBError event of the Transaction object. To coordinate these two events, two additional return values have been added for the DataWindow DBError event, and the meaning of the existing return values is expanded to indicate whether the transaction object's DBError event should be fired.
The meaning of the existing return values for the DataWindow DBError event are modified as follows:
0 Display the error message and trigger the Transaction object's DBError event if it is defined.
1 Do not display the error message, and trigger the Transaction object's DBError event if it is defined.
In PowerBuilder 11.5, two new return values have been added for the DBError event of the DataWindow and DataStore:
2 Display the error message and ignore the Transaction object's DBError event whether it is defined or not.
3 Do not display the error message and ignore the Transaction object's DBError event whether it is defined or not.
SQLPreview When using the Transaction object with a DataWindow or DataStore, the DataWindow or DataStore SQLPreview event is triggered first. If the return value of the DataWindow or DataStore’s SQLPreview event is 0 (Continue processing), the Transaction object's SQLPreview event is triggered.