Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin transaction & sqlsetprop(handle,transactions,2)
Message
From
27/02/2004 13:46:50
 
 
To
27/02/2004 11:56:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00880173
Message ID:
00881577
Views:
27
Thanks for the consideration.

for precision:
IF SQLSETPROP(lnConnection,[Transactions],2) != 1 
* set two flags on ODBC Client, 
* 1° is the implicit status, 2° is a "implicit must to be send"
* ( no packets is send )
 return someError
ENDIF

BEGIN TRANSACTION
&& also start transaction on local Cursoradapter's so they could be 
&& rolled back if neccessary

* first SQLEXEC() executed send the status to the backend server
* but a SQLPREPARE() not send the status !

..
make some updates
..

&& and if all updates/inserts returned .T.
&& try to commit them

IF SQLCOMMIT(lnConnection) = 1
  END TRANSACTION && also commit local changes
ELSE
  SQLROLLBACK(lnConnection) && <==== but if this return a error, what do you do ? Panic ?
  ROLLBACK 
ENDIF

&& and finally change the transactionmode to automatic again ..
SQLSETPROP(lnConnection,[Transactions],1)
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform