PRB: ON ERROR Not Called When Trigger Fails in Browse or GridLast reviewed: April 30, 1996Article ID: Q130131 |
The information in this article applies to:
SYMPTOMSTriggers that fail while working interactively in a Browse or a Grid are not captured by the ON ERROR Routine. Instead the Default Message, "Trigger Failed" is displayed. This seems inconsistent with what is documented in the Help file and in the "Language Reference" manual under CREATE TRIGGER.
CAUSEThis is because the firing of a trigger in the context of a Browse or Grid leaves the control in the hands of the Browse or Grid after the trigger fires. If the normal error handler (the one that allows for ON ERROR) is called, the option of RETRY becomes applicable. But because the Trigger code finished executing, the last command to be retried is the Browse. Therefore, choosing the RETRY option results in two problems:
WORKAROUNDOne way to work around this problem is to trap the failed triggers at the Engine level, not at the Object level. In this case, put the appropriate code to handle erroneous conditions in the trigger itself. This workaround is shown below in the "More Information" section.
STATUSThis behavior is by design. We are researching this design decision and will post new information here in the Microsoft Knowledge Base if it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
Steps to Implement Workaround
|
Additional reference words: 3.00 VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |