Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling errors inside a transaction
Message
 
To
26/06/2001 05:45:41
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00523402
Message ID:
00523513
Views:
12
>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.
>>
>>&& inserts, updates and stuff go here
>>
>>if xError == .T.
>>
>>&& not sure about what to put in here!!!
>>
>>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!"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform