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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ado&vb6 - explicit transactions?

Status
Not open for further replies.

hortensiam

IS-IT--Management
Feb 5, 2002
86
AR
Does anybody know why this cause an error in VB6?
cn. begintrans
cn.execute str1
cn.execute str2
cn.committrans
where cn is a valid connection

when the flow of control reach "cn.execute str1" this
message raise:
no more connections can been created in manual or
distributed transaction mode

thanks,

 
You would ahve to know what str1 is as well Craig, mailto:sander@cogeco.ca

Si hoc legere scis, nimis eruditionis habes
 
Your object is in a MTS or Component Services transaction. Since ADO only supports 1 level of transaction and MTS or CS applies that transaction when you request any connection you are not allowed to call this directly. Explict transactions don't fit within the Component transaction model. This is because commiting and rolling back transactions is the responciblity of the ObjectContext Object. This is done when the transaction originator explicitly calls SetComplete or SetAbort or that object goes out of scope in which case commiting or rollback depends on if you've used DisableCommit and if any object in the transaction has called SetAbort.

Does this make sense?
 

It is very well possible that the provider does not support transactions for bulk updates.

And, as CraigSander stated, the sql string may be the problem if it includes DDL operations and the provider doesn't support this transactions with DDL.

And, the problem could well be as SemperFiDownUnda has stated.

>Since ADO only supports 1 level of transaction

ADO supports nested transactions if the provider supports nested transactions...

 
Thanks to all the answers!
I`ve resolved my problem.
My problem was that i use -sqloledb- provider and there was one recordset of the connection opened. When i closed this recordset the problem was resolved. As you 've said ADO supports nested transactions if the provider supports nested transactions and this provider do not support nested transactions...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top