Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Session Variables for Objects

Status
Not open for further replies.

pamam

Programmer
Sep 13, 2001
12
0
0
US
Hi,

I'm new to ASP and so this is confusing. The problem is as follows.

<!-- xyz is our own concoction-->
set recRequestByCust = CreateObject(xyz)

<!--save it for future use by another page-->
If IsObject(recRequestByCust) Then
Session(&quot;RECORDSET&quot;) = recRequestByCust

<!-- I'm done with rec now, and to avoid a memory leak I destroy it -->
recRequestByCust.Close ---------------------1
set recRequestByCust= nothing ---------------2

In another page same session or even in the same page I use

Set newrec = Session(&quot;RECODSET&quot;)
<!-- but it says that it is closed and cannot use it.
if I comment out lines ----1 and ----2 above it works OK.

Q(1)-- Does the session.contents(key) cause an addref() for the object or not when it is copied into the session variable? I've not been able to find this info anywhere.

Q(2)-- Or is our object xyz not constructed properly? All other aspects of the object workd well.
-->

Thanks in advance.
Mel
 
I made an error, I left out the &quot;set&quot; command with the line

Session(&quot;RECORDET&quot;) = recRequestByCust,

it should be

set Session(&quot;RECORDET&quot;) = recRequestByCust,

I have it in the code, just not the posting.

Mel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top