?
Solved

Error: more than one hdbc connection in use

Posted on 1999-01-12
5
Medium Priority
?
519 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
cognition earned 600 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

762 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