|
-
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
-
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
Similar Threads
-
By karthikeyan in forum VB Classic
Replies: 1
Last Post: 11-18-2002, 08:45 AM
-
By Kevin MacCallum in forum VB Classic
Replies: 0
Last Post: 08-28-2002, 11:46 AM
-
By Yves Reynhout in forum VB Classic
Replies: 1
Last Post: 01-15-2001, 06:20 AM
-
By Jeff Pipes Jeff in forum VB Classic
Replies: 2
Last Post: 10-10-2000, 12:35 PM
-
By Lorenzo in forum VB Classic
Replies: 0
Last Post: 04-17-2000, 05: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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks