Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RI from command window
Message
De
20/08/1999 13:43:10
 
 
À
20/08/1999 09:47:04
Tim Muller
Innovative Solutions, Inc.
West New York, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00255829
Message ID:
00255965
Vues:
28
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform