Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap table errors
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to trap table errors
Divers
Thread ID:
00475024
Message ID:
00475024
Vues:
60
I have posted several request with no answerers. So this is the last time I am posting this in a very simple situation. I know there are a lot of experts and hopefully someone will has an answer to this. Thanks again for broadening our minds and all the help that I get from here.

The staff table has primary key for staffid.


on error wait window str(error())+chr(13)+message()
use staff
browse

Now when I change the staffid I get a general VPF error
"Uniqueness of index STAFFID is violated"
OK, Revert, Help


I was expecting it to show me a wait window with:
1884
Uniqueness of index STAFFID is violated


The error handler (ON ERROR) command does not seem to work ? Any suggestions.

Note:
If the code was:
on error wait window str(error())+chr(13)+message()
use staff
replace staffid with 2 &&2 is already been used in the table

This code does trigger the error handler.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform