Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
How to trap table errors
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement