Results 1 to 2 of 2

Thread: Returning a recordset as an object

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Lincoln,England
    Posts
    60

    Returning a recordset as an object

    I have a class module that returns a recordset in the following way

    public function GetRecordset() as adodb.recordset
    dim rs as adodb.recordset

    '//code to get recordset (disconnected)

    set GetRecordset = rs

    set rs = nothing

    end function

    I understand that this returns a reference to the recordset.

    It is planned that the application will be upgraded to MTS.

    My question is how do I get the function to return an object to the client application rather than a reference?

    As I do not want the recordset in memory on the server

    I have thought that i could use the clone method of a recordset in the client application and destroy the reference to the server side recordset.

    Comments Please

    thanks

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Try sending it as a parameter:
    Code:
    public Sub GetRecordset(ByRef tmpRS as Adodb.Recordset) 
    dim rs as adodb.recordset 
    
    '//code to get recordset (disconnected) 
    
    set tmpRS = rs 
    
    set rs = nothing 
    
    end Sub
    Hope this helps,

Posting Permissions

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



Click Here to Expand Forum to Full Width