Showing posts with label driverconnection. Show all posts
Showing posts with label driverconnection. Show all posts

Tuesday, March 6, 2012

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt?

Our program report the error like this:

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt.

How does this error happen?

How can I fix it?

We use the SqlServer 2005.

Thanks

This occurs when you issue a new query before you've finished consuming the results from your previous query. Most often people are trying to issue subqueries when a JOIN statement in the original would suffice. Otherwise, you can use a different connection to make the subquery or look into MARS (multiple active result sets) for SQL Server 2005.

I don't think this is SSIS-related and should be moved to a different forum.
|||

I have never used ODBC SQL server driver from within SSIS ; I always use either SQL server ole db or .NET provider SQL client data provider.

have you tried one of these yet?

|||

the operation occours this error is just a [update] sentence.

Does this error can be caused by mutil-thread or other reasons?

Thanks a lot

|||I used vc++ and ADO.|||vc++ and ado , then this is probably not SSIS related, you should look in another forum or newsgroup.

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt.

Our program report the error like this:

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt.

I used VC++ and ADO.

How does this error happen?

How can I fix it?

Does this can be caused by mutil-thread?

We use the SqlServer 2005.

Thanks

This is caused by you have a opening result set open against the same connection. For example, you execute a SqlCommand to select all rows from a table, while the result set is not drained, you try to execute another SqlCommand using the same connection, you will hit this error message.

To solve this, you have two choices:

a. Make sure you read the rest data from the pending result set before you send the next SqlCommand.

b. Use MARS (Multiple Active ResultSet) connection setting to enable multiple active result set in a connection. See http://msdn2.microsoft.com/en-us/library/ms345109.aspx

for more details.

Thanks!

Ping

|||

Refer to MARS, http://msdn2.microsoft.com/en-us/library/ms345109.aspx.

It is seems that the SQL SERVER 2005 has already fixed it, isn't it?

Thanks

|||

If I'm reading your error message correctly, the issue is that you're using a pre-SQL 2005 driver. Although the SQL 2005 Server understand MARS, you'll need to use the SQL 2005 driver in order for your application to be able to use it.

You'll need to connect using the "SQL Server Native Client" driver instead of the "SQL Server" driver.

Hope this helps!

~Warren

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt.

Our program report the error like this:

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt.

I used VC++ and ADO.

How does this error happen?

How can I fix it?

Does this can be caused by mutil-thread?

We use the SqlServer 2005.

Thanks

This is caused by you have a opening result set open against the same connection. For example, you execute a SqlCommand to select all rows from a table, while the result set is not drained, you try to execute another SqlCommand using the same connection, you will hit this error message.

To solve this, you have two choices:

a. Make sure you read the rest data from the pending result set before you send the next SqlCommand.

b. Use MARS (Multiple Active ResultSet) connection setting to enable multiple active result set in a connection. See http://msdn2.microsoft.com/en-us/library/ms345109.aspx

for more details.

Thanks!

Ping

|||

Refer to MARS, http://msdn2.microsoft.com/en-us/library/ms345109.aspx.

It is seems that the SQL SERVER 2005 has already fixed it, isn't it?

Thanks

|||

If I'm reading your error message correctly, the issue is that you're using a pre-SQL 2005 driver. Although the SQL 2005 Server understand MARS, you'll need to use the SQL 2005 driver in order for your application to be able to use it.

You'll need to connect using the "SQL Server Native Client" driver instead of the "SQL Server" driver.

Hope this helps!

~Warren