ADO Recordset closed after execution with no records returned
-
Hi, I am having an issue with a recordset that is closed after executing a query. The query that I am using is shown below in Query 1. However, When I change this query to 'SELECT * FROM SOMETABLE', then the recordset is not closed and an open record set is returned. Any ideas? Below is my code: Code:
//vSource is the the query below
//vConnection is a active open connection
//eCursorType = adOpenStatis
//eLockType = adLockOptimistic
//eOption = adCmdText. I tried combining this with adExecuteRecord using
// Bit OR with an error. Bit AND caused no errors
// but also returned a closed recordset
pRst->raw_Open(vSource, vConnection, eCursorType, eLockType, lOptions);Query 1:
DECLARE @Id bigint
SET @Id = 2539
if OBJECT_ID('tempdb..#dumpTable','local') IS NOT NULL
BEGIN
DROP TABLE #dumpTable
ENDCREATE TABLE #dumpTable
(
Depth bigint,
Parent bigint,
Type bigint,
ID bigint,
Name nvarchar(80)
)
BEGIN
--SOME WORK
SELECT * FROM #DumpTableDROP TABLE #DumpTable
END