Database Programming Techniques > Handling Database Errors > Errors caused by cancellation |
There are times when the source of an error is difficult to determine. The most common case of this is an error which reports "Action canceled by an associated object." In most cases, this will be the result of a database operation which has not been completed because a bound control has denied permission for the operation to complete. Commonly, this will be the result of a canceled event. For example, suppose the grid's BeforeUpdate event is canceled. The cancellation is reported to the Data control, which simply reports the cancellation back to the grid. The Data control does not have knowledge of the reason for cancellation; it only knows that it has occurred. Therefore, it issues the generic "Action canceled by an associated object" message. In this case, since the cancellation is performed by your code. It is your responsibility to display an informative error message and cancel the default error message generated by the Data control.