Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server transactions and VFP
Message
From
24/06/2011 10:13:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
SQL Server transactions and VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01515853
Message ID:
01515853
Views:
167
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
Next
Reply
Map
View

Click here to load this message in the networking platform