Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Begin Transaction command in VFP and SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00947828
Message ID:
00947837
Vues:
20
Hi Bernard,

Sorry bout the sample code my mistake. I used only one connection. Here is the original code

begin transaction
SQLExec( nConn, 'BEGIN TRANSACTION' )
* Update changes to biophysicalrv remote view.
lEverythingOK = tableupdate( 2, .F., 'biophysicalrv' )
if lEverythingOK
* Update changes to itemsrv.
lEverythingOK = tableupdate( 2,.F.,'itemsrv')
endif

lEverythingOK = .F. && I placed this code to tell the program that it needs to roll back the transactions.

* End the transaction on the server and VFP.
If lEverythingOK
SQLExec( nConn, 'IF @@TRANCOUNT > 0 COMMIT' )
end transaction
else
SQLExec( nConn, 'IF @@TRANCOUNT > 0 ROLLBACK' )
rollback
Endif
Music Rocks www.musicreserve.blogspot.com
Success is 1% Inspiration & 99% Perspiration
God Sometimes Delays His Help to Test Our Faith and Energize Our Prayers
Our Boat May Be Tossed While He Sleeps, But He Wakes Up Before it Sinks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform