Solved

Error: more than one hdbc connection in use

Posted on 1999-01-12
5
512 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
ID: 1498951
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
ID: 1498952
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
ID: 1498953
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
ID: 1498954
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
ID: 1498955
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best way to parse out a json string in VB6? 10 223
Copy a row 12 64
MsgBox 4 68
RUNRMTCMD from AS/400 12 69
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

829 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