View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
FoxWeb automatically rolls back any open transactions in the case of an error, using the following code:
 
FOR fw_txnlevel = 1 TO TXNLEVEL()
 ROLLBACK
NEXT
 
If you want to handle errors differently, then you may want to temporarily use your own error handler:
 
DefaultHandler = ON('ERROR')
* Set your own error handler
ON ERROR DO MyHandler
.
. (your code that needs special error handling...)
.
* Revert back to FoxWeb default error handler
ON ERROR &DefaultHandler
 

FoxWeb Support Team
support@foxweb.com email

Sent by Andrea Caletti on 03/06/2003 05:38:30 AM:
Hello,
 
I would like to use transaction in my vfp code like this simple:
 
begin transaction
code vfp
code vfp
..
..
if not error
   commit
else
   rollback
endif
 
But when foxweb merge the code and there is an error intercepted from foxweb, in which way i can close my transaction with a rollback?
In that way I can intercept eventual errors of the phase of merge?
 
 
Andrea.