Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Begin transaction & sqlsetprop(handle,transactions,2)
Message
De
27/02/2004 13:46:50
 
 
À
27/02/2004 11:56:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00880173
Message ID:
00881577
Vues:
28
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform