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

Error Regarding Connection Clashing From VB front end

Status
Not open for further replies.

tumtoo10

Programmer
Dec 10, 2001
40
0
0
US
Hi All,
I am facing an unusual error.
I am using command object for accessing Store Procedure in some of my forms in my project.
For that I am using active connection as "cn".
Now For some other forms I am using the same connection "cn" For saving purpose.
and in those forms I am using cn.BeginTrans and cn.CommitTrans for saving purpose
(Just Because I am firing to Parent Child tables through different cn.Execute)
Now when I am using my store procedure Forms first and then my other forms
then Error Blows up.......
"More than one ODBC connection is in use"
It is giving the error at cn.BeginTrans
Please Help me regarding this.
Thank You.
 
This is probably because you already have an open transaction on the connection. You need to make sure that all transactions are closed (either with CommitTrans or rollback trans) before another transaction is opened.

If you try a cn.BeginTrans and then another cn.BeginTrans , the application will fail as you have already started a transaction, but not ended it.

Hope this Helps,


Chris Dukes
 
Well dukes,
In my case i have proper Begin and Commit and rollback trans in front end and also in stored procedure.My problem is if i run a form executing a stored proc using command object which inturn uses the same connection of the form,the current record saves ,but after that problem starts. As i excutes cn.begintrans in any other form , the error comes up.
Whats thats like...Any clues...?Is me using same connection for form and executing stored procedure causing problem.?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top