>Hi alonso
>
>How about a ROLLBACK and handle the error ? thus:
>
>IF lError
> ROLLBACK
>ELSE
> END TRANSACTION
>ENDIF
>...
>...
>IF lError
> .. handle the error
>ENDIF
>
>Walter,
>
>>How can i "friendly" handle errors inside a transaction?
>>
>>I was thinking about something like this:
>>
>>
>>
>>xOldError = ON("ERROR")
>>
>>BEGIN TRANS
>>
>>ON ERROR xError = .T.
>>
>>
>>
>>if xError == .T.
>>
>>
>>
>>endif
>>
>>ENDTRANS
>>
>>ON ERROR &xOldError
>>
>>
>>Any help is welcome.
>>
>>TIA,
>>
>>Alonso
Walter,
I was thinking about something that i could tell the user exactlly what happened. Something like "Duplicated PK" (this i check before BEGIN TRANS), etc.
So, i would issue a ROLLBACK knowing why i had to.
OK??
Thanks!
Like Frank said: "I did it... MY WAY!"