MS DTC Distributed Transactions

Applications written using OLE DB, ODBC, ADO, or DB-Library can use Transact-SQL distributed transactions by issuing Transact-SQL statements to start and stop Transact-SQL distributed transactions. OLE DB and ODBC, however, also contain support at the API level for managing distributed transactions. OLE DB and ODBC applications can use these API functions to manage distributed transactions that include other COM resource managers that support MS DTC transactions other than Microsoft® SQL Server™. They can also use the API functions to gain more control over the boundaries of a distributed transaction that includes several SQL Servers.

ODBC Distributed Transactions

You can control local transactions at the ODBC API level by setting the connection attribute SQL_ATTR_AUTOCOMMIT to SQL_AUTOCOMMIT_OFF, and then by calling the ODBC SQLEndTran function to commit or roll back each transaction. Do not use these functions to manage a distributed transaction in an ODBC application. Use the MS DTC COM methods instead:

OLE DB Distributed Transactions

The model for controlling a distributed transaction in OLE DB is similar to controlling a local transaction. To control a local transaction, an OLE DB consumer:

To control a distributed transaction, the consumer instead:

See Also

Performing Distributed Transactions

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.