Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested VB transactions with SQL produce error.

Status
Not open for further replies.

arnierudy

Programmer
Mar 26, 2002
12
US
My VB app is currently being upsized from DAO using Jet to ADO 2.6 with SQL 2000, using the SQLOLEDB.1 provider. I have transactions in the VB code using the .BeginTrans method of the connection. In some cases there are nested transactions. These were never a problem with Jet, but now the second Begintrans produces the error "Cannot start more transactions on this session.". The documentation mentions "SET XACT_ABORT ON", but it is not clear to me if this will have any effect on a VB app or if it can even be envoked through VB. I tried using the .Execute method of the connection to run this but, while not producing an error in itself, it had no effect on the nested transaction error.

1. Would "SET XACT_ABORT ON" be of any help to me in my VB app?

2. If so, can it be done through VB code, and how?

3. If not through VB code, can it be put in the connection string or in the script that creates the SQL data base, or called through a system stored procedure, or something else?

4. If none of the above, is there any other way to use nested transactions other than trapping the error?

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top