Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error: more than one hdbc connection in use

Posted on 1999-01-12
5
Medium Priority
?
520 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

636 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