Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server transactions and VFP
Message
De
24/06/2011 10:13:01
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
SQL Server transactions and VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01515853
Message ID:
01515853
Vues:
168
I am confused as to the manner in which cursor adapters operate in relation to transactions in a VFP9 SP2 front end /SQL Server back end.
I issue the T-SQL Begin transaction command and then set the transactions to manual. Then I start saving to each individual table with an insert to the cursor adapter and then a tableupdate. The tableupdates always return succes, then I issue the T-SQL commit transaction command, followed by the setting of transactions to automatic.
Yet, when I check the SQL tables, nothing was saved. I create the cursor adapters with the optimistic table buffering setting (5).
Example of what I do:
sqlexec(nHandle,'BEGIN TRANSACTION')
sqlsetprop(nHandle,'Transactions',2) && manual
insert into cursoradapter1....
lOK = tableupdate(.t.,.t.,'cursoradapter1')
if lOK
insert into cursoradapter2
lOK = tableupdate(.t.,.t.,'curadapter2')
endif
if lOK
sqlcommit(nhandle)
else
sqlrollback(nHandle)
endif
sqlsetprop(nHandle,'Transactions',1) && automatic
However, nothing gets saved to the SQL Tables

Why?
Rafael Copquin
Treasurer - Microsoft Users Group of Argentina (MUG)
www.mug.org.ar
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform