Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get error from SQL 7
Message
From
10/11/1999 09:24:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
How to get error from SQL 7
Miscellaneous
Thread ID:
00289531
Message ID:
00289531
Views:
62
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
Next
Reply
Map
View

Click here to load this message in the networking platform