Link to home
Start Free TrialLog in
Avatar of Skyscrape
Skyscrape

asked on

ADO Record Sets in VBSCRIPT

How can I copy contents of a recordset into a new recordset, and be able to access the new one after closing the connections (both ado.connection and ado.recordset close)
ASKER CERTIFIED SOLUTION
Avatar of dzimme01
dzimme01

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Skyscrape
Skyscrape

ASKER

This is the same solution offered in the MSDN library and the ADO reference.  However, I think this solution only works with SQL server, or more to the point it does not seem to work with an Oracle Server.  One solution is to create a recordset using RDS like so:
      Dim ds  
      Dim df  
      dim rs  
      Set df=Server.CreateObject("RDSServer.DataFactory")
      Set rs = df.Query("DSN=MYDSN;UID=MYUID;PWD=MYPWD;", _
                     "SELECT * FROM ExpenseCodes")
      Set rs.ActiveConnection = nothing  
           
But I dont like that solution.

I don't have access to an Oracle server, so I'll have to take your word that this doesn't work. But since OLE DB providers should support a certain amount of functionality, I was wondering what exactly doesn't work. What is the error returned from the object? I'm also assuming that what your trying to accomplish, is to get a recordset and manipulate it while limiting the number of open connections to your database. Is this correct? Also what version AD0 are you using, and what version of IIS?
That is correct.. To basically have a recordset without a connection. ADO1.5 i think, with IIS 4.0
Using the Recordset.Supports property is the easiest way to verify that what you expect is actually what the provider exposed to you, given the specific type of connection and recordset you have opened. I would suggest checking if Oracle's OLE DB driver supports disconnected recordsets and batch updates. If it does, rather than cloning or duplicating a recordset, just disconnect the activeconnection and reconnect and use updatebatch. Then you have the recordset without the open database connection.