Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get error from SQL 7
Message
De
10/11/1999 09:24:41
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
How to get error from SQL 7
Divers
Thread ID:
00289531
Message ID:
00289531
Vues:
61
Hi,

I have a trigger on a table (for delete) that prevents the deletion under certain circumstances and uses RAISERROR to provide feedback. This works fine in Query Analyzer - just like it's supposed to - that is - if I try to delete a record that "I'm not allowed to" - it isn't deleted and the message I specified in RAISERROR is returned.

However - when I do the same thing from SPT in VFP - SQLEXEC does not seem to "know" that my error happened (though the record is still correctly prevented from being deleted) SQLEXEC just retruns 1 and assumes eveything is fine. So question, what do I need to do for VFP to realize that the trigger issued a ROLLBACK and a RAISEEROR and to get that message from RAISERROR into VFP for user notification purposes?

My syntax in that portion of the trigger is ...

<snip>
IF @passedtest
Do some stuff
ELSE
ROLLBACK TRANSACTION
RAISERROR ('My error message', 10, 1) with SETERROR, NOWAIT


Thanks!
Ken
Ken B. Matson
GCom2 Solutions
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform