According to the BOL documenation of the ExecuteSQLTask you can populate a variable with a resultset. I specified a variable of type 'Object' and followed the instructions and everything is fine untill then.
However later I want to access the variable in a script task and it appears that the variable is populated with a System.__ComObject.
How do I access my rows from here
Your suggestions would be appreciated.
Regards,
Henk

How to access data in resultset returned in variable by ExecuteSQLTask
Ibrahim Y
Well it looks like you'ev got it working anyway.
Is there a reason why you couldn't shred the object in a Foreach loop as Darren suggested Its much easier than writing code!
Regards
Jamie
Yicong Shen
Depeding what you want to do the ADO For Each may help. See the example used in here-
Shredding a Recordset
(http://www.sqlis.com/default.aspx 59)
Shaunkerr
Ayan Debnath
Neil Kiser
Jamie and Darren, Thanks for the input.
Jamie, I already studied your blog article, but it was not clear to me how from that how to get hold to the recordset object and iterate it. The moving of the adodb.dll still is needed, but changed slightly: copy it from C:\Program files\Microsoft.Net\Primary Interop Assemblies to C:\Windows\Microsoft.NET\Framework\v2.0.50215 (or what ever the VSA add reference wizard looks in for dlls)
The code to grap the recordset and iterate the records I ended up with:
Public Sub Main()
Dim rs As ADODB.Recordset
Dim myVariableValue As Object = Dts.Variables("myVariable").Value
rs = CType(myVariableValue, ADODB.Recordset)
Dim count As Int32 = rs.RecordCount()
While (Not rs.EOF)
Dim fields As Fields = rs.Fields
'Do something with the record
'Dim field As Field = fields(0)
'MsgBox(field.Name() + " - " + field.Value().ToString())
rs.MoveNext()
End While
Dts.TaskResult = Dts.Results.Success
End Sub
ChampAmp
Note that this was written quite a while ago so its possible the stuff about moving DLLs may not be necassary.
-Jamie