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