Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trapping a RI Delete Error
Message
De
03/04/2000 21:15:22
 
 
À
02/04/2000 18:58:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00354025
Message ID:
00354723
Vues:
23
>>If I have defined relations between two tables in the DBC and generated RI code for deleting. How do I trap an error when I try to delete a record that can't be deleted? In otherwords if I have an updateable grid and the user clicks on the delete box in the grid. In my save button I do a TABLEUPDATE. Is there a way to trap that error from the RI code? >> >>Thanks > >Been a while since I looked at the generated RI code, but I believe it creates a public array with error info in it. You should be able to trap the error in your form's error event, and check the contents of gaErrors[] (or whatever it is called) to give the user a meaningful message.

I had a similar problem and decided to eliminate the delted mark and provide a command button for an explicit. I also inserted a check in the AfterRowColChange event to enable/disable the delete command button based on my business rule for deleting.

Glen Mettler
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform