Solved

Error: more than one hdbc connection in use

Posted on 1999-01-12
5
504 Views
Last Modified: 2013-12-25
When I try to do a "BeginTrans" for a Connection
(f.e. frmMain.gcnProgramManagement.BeginTrans)
I get the always following error:
Can not start transaction because more than one hdbc connection in use.
Error Nr.: -2147168227 / 8004d01d

What's the problem and how can i fix it?
0
Comment
Question by:gautschi
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
cognition earned 150 total points
Comment Utility
I am guessing you are using rdo.

You have another transaction open, or the connection still has not finished processing the last command.

For example if you return a resultset, and loop through it, but stop half way, and then try and issue another command you will get this error.

This especially happens, if you start using asynchronous cursors, and start one query, and then try another. To do two queries at the same time you will need two connections.

You either need to ensure that you pull all the data back, or set the resultset to nothing. You can also try using a different cursor type/driver. Forward Only, ReadOnly.


0
 

Author Comment

by:gautschi
Comment Utility
I'm using ADO. and as far as i know i have just one recordset open. i can't use a ReadOnly cursor, because i have to update the recordset.

I wanna do sth like that
conn.BeginTrans
  rs.Update
conn.CommitTrans

If it would help you I can send you an example code.
0
 
LVL 3

Expert Comment

by:cognition
Comment Utility
When you open the recordset, do you return all the rows you are going to operate on, before you start updating?

Are you returning multiple rows ?
Can you send a bit more code, that recreates the error ?
0
 

Author Comment

by:gautschi
Comment Utility
Sorry - you were right - I had still a recordset open that wasn't closed :( anyway, thanks for your help! (btw: why can't I have 2 recordsets open and do a BeginTrans, at the same time?)
0
 
LVL 3

Expert Comment

by:cognition
Comment Utility
Becasue the first recordset is still using the connection to retrieve data.

You can have multiple recordsets open, just not retrieve the data for them at the same time.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to refer to cell 8 74
Replace Formatted Numbers with text 9 50
Excel object stays open 19 64
using Access 8 52
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now