ADO and Object Marshalling


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ADO and Object Marshalling

  1. #1
    Russell Sinclair Guest

    ADO and Object Marshalling


    Bill,
    We are creating a product that will be using COM+ with ADO to retrieve data
    for a client application. I have been taught (rightly or wrongly) to use
    ByRef when passing objects as parameters in VB to reduce the overhead of
    cloning an object and the unexpected results it may cause.

    Does this hold for ADO and COM+? Should we be passing Recordset objects back
    to the server ByRef or ByVal?

    Thanks,
    Russell
    Share on Google+

  2. #2
    Bill Vaughn Guest

    Re: ADO and Object Marshalling


    I'm no OO expert, but Edward (my tech editor) is. He says:

    Passing an object ByRef or ByVal does not clone the object.

    The only diference is that from the function any changes
    done to the object pointer will not be marshalled back,
    so the client will still hold a reference to whatever it passed in.

    Eg: This comes back with a dead recordset
    Public Sub F(ByRef myrs As Recordset)
    myRS.Dosomething
    Set myRS = New Recordset
    End Sub

    Eg: This does not, and the client has the something done on its RS
    Public Sub F(ByVal myrs As Recordset)
    myRS.Dosomething
    Set myRS = New Recordset
    End Sub







    "Russell Sinclair" <rsinclair@questica.com> wrote:
    >
    >Bill,
    >We are creating a product that will be using COM+ with ADO to retrieve data
    >for a client application. I have been taught (rightly or wrongly) to use
    >ByRef when passing objects as parameters in VB to reduce the overhead of
    >cloning an object and the unexpected results it may cause.
    >
    >Does this hold for ADO and COM+? Should we be passing Recordset objects

    back
    >to the server ByRef or ByVal?
    >
    >Thanks,
    >Russell


    Share on Google+

Similar Threads

  1. Replies: 1
    Last Post: 11-18-2002, 09:45 AM
  2. Re: ORACLE Speed with ADO - try comand object
    By Kevin MacCallum in forum VB Classic
    Replies: 0
    Last Post: 08-28-2002, 12:46 PM
  3. Replies: 1
    Last Post: 01-15-2001, 07:20 AM
  4. Whats new in ADO 2.6?
    By Jeff Pipes Jeff in forum VB Classic
    Replies: 2
    Last Post: 10-10-2000, 01:35 PM
  5. Replies: 0
    Last Post: 04-17-2000, 06:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center