Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Triggers and stuff
Message
From
17/02/2004 16:21:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/02/2004 16:05:01
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00878099
Message ID:
00878104
Views:
14
>Hi
>
>I am wanting to create a rule that prevents records from being deleted if there are records in a child table. I can do this quite easily via referential integrity but I dont want the standard mesage to display. I believe this can be stopped by buffering the table and using ones own messages but doesn't work with views where the table is not buffered.
>
>Is there a way to prevent the standard error message coming up in all cases?
>
>Regards
>Geoff Scott

You mean the standard message "trigger failed", right?

What I did is create a function that searches for child records, before trying to delete. If there are child records, I show my own message instead. I used the same message for all tables: "The record is being used in table (tablename)".

I don't have the corresponding function available right now, but I can search for it when I am back at home, in about a week, if you are interested.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform