Using the SQLOLEDB provider, whenever I call a stored procedure that uses a temp table, I get the error message \"3704 - The operation requested by the application is not allowed if the object is closed.\" Why?
The SQL Server OLE DB provider (SQLOLEDB) has a new behavior designed to provide more accurate information about what happened in the stored procedure.
Each SQL statement within a stored procedure returns a \"result\", either a count of rows affected, or a resultset. You can walk through these result sets in ADO using the NextRecordset method on the Recordset object.
If you don\'t want this more accurate information, then put the \"SET NOCOUNT ON\" statement at the beginning of the stored procedure.
For more information, see the following Microsoft KB article:
(
http://support.microsoft.com/support/kb/articles/Q235/3/40.ASP)- PRB: Error Messaging Referencing #Temp Table with ADO-SQLOLEDB.