Connection is busy with results for another hstmt
-
Friday, September 22, 2006 1:40 PM
HI guys,
I'm using ODBC driver from WinXP SP2 with SQL Server 2005 Express (on my machine for test) and SQL Server 2005 Standard (on the production machine).
With SQL Server 2005 Express I've no problem, but with SQL Server 2005 Standard, in some query, I get "Connection is busy with results for another hstmt".
I'm working with VisualStudio 2003 with standard CDatabase and CRecordSet MFC classes.
I looked for an advice in the Microsoft KB but I found only Service Pack for SQL Server 2000 !
Everything could be useful !
Thanks a lot!
Bye, Domenico
Answers
-
Thursday, October 11, 2007 5:42 PMModerator
sqlncli.h has the constants you are looking for.
It is in %program files%\Microsoft SQL Server\90\SDK\Include
Lib is at %program files%\Microsoft SQL Server\90\SDK\Lib
All Replies
-
Friday, September 22, 2006 7:36 PMModerator
You can avoid this error message by switching to the SQL Server 2005 ODBC driver, 'SQL Native Client' and enabling the MARS (Multiple Active Result Sets feature). There is more information in Books Online and also here http://blogs.msdn.com/dataaccess/archive/2005/08/02/446894.aspx
-
Thursday, October 11, 2007 2:47 PMI need to enable MARS using ODBC & VB6 (
) but I have not been able to find where the constants in the statement below are defined. If anyone could help me find the values for the constants it would be greatly appriecated
SQLSetConnectAttr(hdbc, SQL_COPT_SS_MARS_ENABLED,SQL_MARS_ENABLED_YES, SQL_IS_UINTEGER);
-
Thursday, October 11, 2007 5:42 PMModerator
sqlncli.h has the constants you are looking for.
It is in %program files%\Microsoft SQL Server\90\SDK\Include
Lib is at %program files%\Microsoft SQL Server\90\SDK\Lib
-
Thursday, October 11, 2007 7:40 PMModerator
Alternatively you can control MARS from the connection string. In OLE DB it's "MarsConn=yes", for ADO it's "MARS Connection=true" and for ODBC it's "MARS_Connection=yes".

