none
OLEDB Disconnected datasets ?

    Question

  • Im converting code from one of our vb6 apps. I used to use the ADO clone command to duplicate the returned records allowing me to loop through records and fire off new sql commands with the same connection without overwriting the connection to the original looping record set.

    Im now trying to use OLEDB

    All good until I want to loop a record set as before.

    When I open the RS and attempt to fill the second record set, the original record set closes and the loop stops with errors

    I keep trying to avoid ADO to create a disconnected record set but am having trouble seeing the difference's

    Anyone sprinkle a bit of knowledge on this for me ??

    Get Record set RD1

    Loop RD1

      New SQL Command on RD2

      Get Record Set RD2

      Do something

    Next RD1

    DB


    Tuesday, July 02, 2013 7:33 PM

Answers

  • Hi,

    We can create a local result set variable and put the first result set data to it, and then open another connection and loop through this local result set. Additionally, you can refer to the methods on the following document:

    INFO: SQL Server Spawns Additional Connections When You Open Multiple ForwardOnly ADO Recordsets
    http://support.microsoft.com/kb/235282/en-us

    Allen Li
    TechNet Community Support

    Thursday, July 04, 2013 8:20 AM