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
No comments:
Post a Comment