Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Transactoins with CursorAdapters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
SQL Transactoins with CursorAdapters
Divers
Thread ID:
00979491
Message ID:
00979491
Vues:
58
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform