Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AERROR
Message
From
06/07/1999 18:55:29
 
 
To
06/07/1999 15:53:54
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: AERROR
Miscellaneous
Thread ID:
00237782
Message ID:
00238008
Views:
15
>Thanks Erik,
> This is a clip of the delete routine in trouble. Like you said, AERROR returns the last VFP error, however, this is a new "legit" delete that is failing. How do you trap failed and successful triggers???
>

I always handle this by checking the return results of TABLEUPDATE(), but obviously, this only works with buffering on. If you don't want to use buffering (I highly recommend that you do), I guess you could just check the value of DELETED() right after you delete the record. If the record was not successfully deleted, then you could check AERROR().

>DELETE IN (.cPrimaryAlias)
>IF AERROR(aDeleteError) > 0
> IF aDeleteError[1] = 1539 ; && Trigger failed
> AND aDeleteError[5] = 3 ; && Delete Trigger
> .Error(aDeleteError[1]) && For message Only
> .Revert()
> RETURN .F.
> ENDIF
>ENDIF AERROR(aDeleteError) > 0
>
>Thanks...
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform