LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Passing objects by value instead of by reference

I have a program broken into a set of modules. It basically looks like
this:

'---main()---

recset = get_records() 'put SQL data recordsets into
'a recordset array
do_stuff recset 'perform operations on that recordset

'--------

Within the get_records() module, I would like to be able to open the
data connection, retrieve the data, pass the data off to main(), then
close all data connections and restore all variables. However, when I
try to close the connection after passing the recordset array, I get
"object is closed" when I try to do any operations on recset in
do_stuff. I assume this is because I am passing my objects by
reference.

I would like to avoid passing a connection object to main and closing
it there, to simplify the code.

Therefore, how can I pass by value to avoid this problem?

Thanks
Andrew

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing, Declaring, and Assigning Objects tfrank Excel Programming 0 November 1st 04 06:45 PM
Passing Excel Objects As Parameters Jake Marx[_3_] Excel Programming 0 September 17th 04 04:25 PM
Passing Excel Objects As Parameters MDW Excel Programming 0 September 17th 04 04:17 PM
Calling Procedures from another excel sheet by passing objects Thomas Auburn Excel Programming 0 May 5th 04 05:33 PM
Problem passing by reference Ted[_8_] Excel Programming 10 February 23rd 04 07:27 PM


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"