Passing objects by value instead of by reference
when you close the connection, I suspect the recordset is released. You
need to transfer the data to an array.
--
Regards,
Tom Ogilvy
"aspenbordr" wrote in message
oups.com...
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
|