Combine Recordset from two Database Servers

Results 1 to 2 of 2

Thread: Combine Recordset from two Database Servers

  1. #1
    Join Date
    Dec 1969

    Default Combine Recordset from two Database Servers

    I have an existing ASP page that currently calls a component that calls a stored procedure and returns a recordset. <BR>Now the database has been split on to two servers. Due to query design and the inability to use linked servers I now need two separate stored procedure calls and two recordsets. I would like the component to continue to return the same recordset.<BR><BR>Is there a way to combine two recordsets to create a new recordset? Or is there a way to create a recordset from the information in variables rather than from a database, i.e. set objRS("Name") = value

  2. #2
    Join Date
    Dec 1969

    Default An alternative suggestion or three...

    How about returning a 2-D *array* instead of a recordset as the combined result??? Since you can always do ADODB.RecordSet.GetRows to convert a recordset to an array, this would be a logical transformation.<BR><BR>Other alternatives:<BR><BR>(1) Create a "wrapper" class (even a VBS class, if need be) that actually retains both recordsets and, when you call "GetNext" gives the caller the next logical one from the combined set.<BR><BR>(2) Create an ActiveX object that mimics a RecordSet (at least so far as your other code needs it to) and have *it* implement (1), just above.<BR><BR>Anyway, if you *must* do so, you could create a disconnected recordset and add records to it. But oh, man, is that a *very* slow and *very* painful way to do it. <BR><BR>FINALLY...a really ugly solution, but it *would* work:<BR><BR>Are you aware that, under the covers, a RecordSet is essentially and array of collections? Think about it a second: You can do AbsolutePosition to any record, same as moving to an element of an array. Then, at the given record, you access fields either by name or by ordinal number, the same way you access a Scripting.Dictionary instance!<BR><BR>SO...<BR><BR>You *could* simulate a RecordSet using an array of Scripting.Dictionary instances. Ugh. To say the least.<BR><BR>Sure you can&#039;t settle for a 2-D array?<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts