473,799 Members | 3,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ODBC Connection busy error

I am having multiple threads in my c program to execute same procedure
with differnt parameter values every time.
I have created different functions to execute the same.
However when SQLExecute is run on one of the thread it returns an
error saying
[Microsoft][ODBC SQL Server Driver]Connection is busy with results for
another hstmt
How do I call the same stored procedure on different threads to
execute at the same time.
Jul 20 '05 #1
2 2962
Use a different connection for each thread. I believe the problem is that
your SQL statements probably returns a result set and you are trying to use
the same connection to return multiple result sets.

"vishal" <vi************ **@mentorix.com > wrote in message
news:f1******** *************** ***@posting.goo gle.com...
I am having multiple threads in my c program to execute same procedure
with differnt parameter values every time.
I have created different functions to execute the same.
However when SQLExecute is run on one of the thread it returns an
error saying
[Microsoft][ODBC SQL Server Driver]Connection is busy with results for
another hstmt
How do I call the same stored procedure on different threads to
execute at the same time.

Jul 20 '05 #2
[posted and mailed, please reply in news]

vishal (vi************ **@mentorix.com ) writes:
I am having multiple threads in my c program to execute same procedure
with differnt parameter values every time.
I have created different functions to execute the same.
However when SQLExecute is run on one of the thread it returns an
error saying
[Microsoft][ODBC SQL Server Driver]Connection is busy with results for
another hstmt
How do I call the same stored procedure on different threads to
execute at the same time.


It has nothing to do with that you are calling the same procedure in
different threads. It has to do with that you are trying to use the
same connection for simulataneous requests.

The most common reason for this error is a failure to get all rows and
result sets from the server. This could be because you have not anticipated
extra result sets generated by "rows affected" messages. These messages can
be turned off with SET NOCOUNT ON, and this is usually a good practice to
do, because it improves performance. (Of course, sometimes you need these
messages, in which case you should keep NOCOUNT off.)

If you are accessing SQL Server from separate threads, each thread should
probably have its own connection. If not, the connection is a common
resource, and the threads must use a semaphore or some other locking
mechanism, to be able to access the common resource.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6786
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
0
5380
by: Bob | last post by:
I have an ASP.NET web application that has been running without any problems for a while. I recently transferred the site to shared hosting and had multiple users start to use the site. The problem I'm experiencing is that when many users are hitting the site at once, occasionaly I will see errors. The 3 most common ones are: "The SqlCommand is currently busy Open, Fetching. ", "Internal Connection Fatal Error", "object reference not set to...
4
3574
by: Dave | last post by:
Hey guys, I have an ODBC problem that has me stumped. I wrote a VBA script to run in Microsoft Excel that pulls data out of an application using that application's ODBC driver and puts it into Excel. I am trying to translate the same program over to Microsoft Access and I ran into a problem. Access locks up if the data I am querying for is not present in the database. To retrieve data from the database of the application, my Excel...
7
1608
by: HB | last post by:
Guys, How to use ODBC with a DB connection in ASP.NET? each time I try to add the ODBC name in the connection an error telling that it is not compatible (or so) to use ODBC. I have .NET 2002 with ver. 1 framework. Thanks
1
4161
by: Jordi | last post by:
Hi, I have a problem when accesing data with and ODBC provider under asp.Net applications. The question is that if I run the application in the same server where data is stored then data is displayed normaly, but if the ODBC catalog file is in other computer in local netwok (with his Domain Server SBS 2003) I receive next error: ERROR File not found. ERROR Error de SQLSetConnectAttr del controlador ERROR El controlador no admite...
0
12069
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
3
12958
by: Greg Strong | last post by:
Hello All, Is there any way to close an ODBC connection via DSN without completely closing the Access front-end? I'm doing some testing with using Access as a front-end to Oracle 10g Express edition. When the user ID and password is entered on a form and after a successful connection it seems Access doesn't change the connection. Even if I enter an invalid user ID and/or password the connection continues to work.
8
9641
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query work from
3
2570
by: zombiechewtoy | last post by:
I'm having trouble making an ODBC connection using VB.NET 2005. I have tried nearly every connection string found on connectionstrings.com, in almost every format I can think of. I have tried both of the following drivers, as well. Oracle ODBC Driver (version 8.01.05.00) Microsoft ODBC for Oracle Basically, I end up with the same generic error no matter what I try. Here's my code. Try
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.