Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RI from command window
Message
From
20/08/1999 13:43:10
 
 
To
20/08/1999 09:47:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00255829
Message ID:
00255965
Views:
27
>I am in New York and the system is in Chicago. The power user in Chicago who administers the system has a copy of VFP. From the command window she has deleted records from a table that are referenced from another table. I am in the process of creating a Delete Trigger (actually a stored procedure called by the trigger) which will scan the other tables for references to the deleted record and reject the delete if busts RI. Things are working fine except that if I RETURN .F. when I detect a problem, I get a VFP error message about the trigger failing. I have my own message and I would like to stop the VFP message. I tried doing a RECALL and RETURN .T. VFP was not happy about the RECALL in the trigger.
>
>I stuck an ON ERROR in the trigger. That does not fire. I am about to KEYBOARD a RECALL as I leave the trigger when the trigger wants to reject a delete. That strikes me as less than elegant.
>
>Any thoughts?
>
>Tim

I don't know if you can do this from within the stored procedure. Why would you want to? A failed trigger is a failed trigger. When a user does something illegal in the VFP environment, they should get a VFP error message. In the application that should be deleting the records, you can trap for the "trigger failed" error number, and give your message depending on some global variable created in the trigger when it failed.

If you need to do this inside the VFP environment, you'll want to put in place your custom error handler in the VFP environment.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform