Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Transactoins with CursorAdapters
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
SQL Transactoins with CursorAdapters
Miscellaneous
Thread ID:
00979491
Message ID:
00979491
Views:
57
I am using three cursoradapters to update a sqlserver database with changes to an order:
ca_OrderHeader
ca_ShipmentHeader
ca_OrderDetail

How do I wrap this into a single transaction on SqlServer?

I'm basically doing the following using an odbc connection to the server(oxml is the xmladapter from which the cursors were generated and nTables is the number of cursors in the adapter) the error handling code has been stripped out :
 SQLSetprop(nHandle, 'Transactions', 2)  
  lRet = .T.
  For i = 1 To nTables
        cAlias = oxml.Tables[i].Alias      
        If lRet
            if not Tableupdate(lnRows, llForce,cAlias,'aRowResults')
              lRet = .F.
            Endif
        Endif
 Endfor

 If lRet
   Sqlcommit(nHandle) 
 Else
    Sqlrollback(nHandle)
 Endif

 SQLSetprop(nHandle,"Transactions",1)
However, it appears as if each tableupdate is committing the transaction rather than waiting for the manual commit..
What am I missing?
Next
Reply
Map
View

Click here to load this message in the networking platform