Re: Transactions.
From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 01/24/05
- Next message: Stephen Howe: "Re: Fields not longer available when subclassing the _RecordsetPtr cla"
- Previous message: Stephen Howe: "Re: get multivalued data from a Recordset"
- In reply to: Sam Davis: "Transactions."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 Jan 2005 18:18:49 -0000
> Does anyone know if their is a way in ADO not ADO.NET to change the
> connection to use EXPLICIT TRANSACTIONS with SQL SERVER.
Just call methods BeginTrans, CommitTrans or RollbackTrans of a ADO
connection object.
This is from my SQL Server 2000 Books online on "Explicit Transactions".
You might find the extract useful
>>>>>>>>>>>>>
You can also use explicit transactions in OLE DB. Call the
ITransactionLocal::StartTransaction method to start a transaction. Call
either the ITransaction::Commit or ITransaction::Abort method with
fRetaining set to FALSE to end the transaction without automatically
starting another transaction.
In ADO, use the BeginTrans method on a Connection object to start an
explicit transaction. To end the transaction, call the Connection object's
CommitTrans or RollbackTrans methods.
The ODBC API does not support explicit transactions, only autocommit and
implicit transactions.
Explicit transaction mode lasts only for the duration of the transaction.
When the transaction ends, the connection returns to the transaction mode it
was in before the explicit transaction was started, either implicit or
autocommit mode.
>>>>>>>>>>>>>
You also might want to read up on ADO's IsolationLevel property of a
Connection object.
See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthbegintrans.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdproisolationlevel.asp
Stephen Howe
- Next message: Stephen Howe: "Re: Fields not longer available when subclassing the _RecordsetPtr cla"
- Previous message: Stephen Howe: "Re: get multivalued data from a Recordset"
- In reply to: Sam Davis: "Transactions."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|