Hi
Do not place an object in session.
Here some links ....(applicable to asp.net also)
http://support.microsoft.c
http://www.devx.com/asp/Ar
http://www.oekosoft.ch/ser
RJ
Main Topics
Browse All TopicsOn a WinNT 4 platform (using Visual Basic 6 and ADO) we had used
Session("VW") = r!VW_NF
Now we are using Windows 2000.
That code, shown above, now raises "No default property for object."
If I paste the statement into the debug window though, it runs without error.
If I modify it to be
Session("VW") = CStr(r!VW_NF)
it runs properly.
OK. So I found a work-around.
But now, I have a worse problem.
We have a class that is just a set of properties (let’s call it clsXXX):
Public Value1 As String
Public Value2 As String
. . .
Public Val__n As String
In (for example) ThePage_Respond(), we have
Dim ob As clsXXX
Set ob = New clsXXX
GetValues ob ' This fills the properties. This Sub is not part of the class, it only fills in the object’s properties
Set Session("XXX") = ob ' <——<<<
ThePage.WriteTemplate
Set Session("XXX") = Nothing
At the line marked by the arrow, nothing happens.
The Watch window shows that Session("XXX") is still Variant/Empty.
I need to be able to store objects in the Session.
Is there some flaw in the Windows 2000 environment that cripples Internet Information Server’s ASP objects (Server, Application, Request, Response & Session)?
Are there other issues I am going to run into?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi
Do not place an object in session.
Here some links ....(applicable to asp.net also)
http://support.microsoft.c
http://www.devx.com/asp/Ar
http://www.oekosoft.ch/ser
RJ
In a VB IIS application, your HTML contains replaceable tags. In your VB project, you specify the signature of these tags. Default is WC@, but the books recommend changing that. We use WC.
So when the VB encounters <WC_ while processing an html template, it calls the [templateName]_ProcessTag(
With <WC_Name>-default-</WC_Nam
When processing a request for a template, first the [templateName]_Respond() sub is called, and when that sub has [templateName].WriteTempla
I have some cases where I fill in 80 or 90 separate values on the page, all of which come from an Oracle DB.
I don't want to open that record 80 or 90 times.
I tried using a UDT but that cannot be done because it requires late binding, and an IIS project with even one instance of late binding won't compile.
We switched to using classes, because that facilitates early binding. (You can cause late binding of classes or early binding. There is no way to use early binding with User-Defined Types in VB/IIS.)
In the Respond routine we get the values then close the recordset, and in the ProcessTag routine we use the exposed parts of the class to fill in the values on the page:
Private Sub [templatename]_ProcessTag(
Dim ob As clsWhatever
Set ob = Session("Whatever I Stored The Object As")
Select Case Lcase$(TagName)
Case "wc_name": TagContents = ob.Name
Case "wc_addr": TagContents = ob.Addr
Case "wc_ ...":
End Select
Set ob = Nothing
End Sub
Doing this with individual variables in the Session would be a big mess.
This ran on our WinNT, IIS 4, VB 6 (SP 5) network, but does not on our Win2K
Additionally, no one has addressed the issue that
Session("VW") = r!VW_NF
ran before, but requires
Session("VW") = CLngr!VW_NF)
now. This isn’t an issue of storing objects in the Session, but it still fails to fly.
Part of the reason we had to innovate this is that, whereas this could easily have been done in an .EXE with a global object, that won't fly in IIS. Global object belong to everyone making a request, and this needed to have user-by-user resolution.
riyasjef, those links were informative. They were largely focused on storing objects to re-use between requests, and we aren't doing that in this code I'm focusing on. (I do do that in one place, and that might turn out to be disastrous later, but the topics of those links seem to be slightly to the side of this particular problem, especially considering that I have difficulty assigning a recordset field’s value to a simple Session item.
Brian
I believe the answer to this can be found in http://support.microsoft.c
It has to do with security, and the situation when debugging VB in the IDE.
The ASP session is under the user IWAM_<machine-name>, but the IDE is under the account of the developer. Since the COM+ objects are instantiated by one of these ‘users,’ the ‘user’ associated with the IDE cannot gain access to the objects belonging to IWAM_<machine-name>, and vice verse.
Brian
Business Accounts
Answer for Membership
by: TRUENEUTRALPosted on 2004-11-15 at 14:24:53ID: 12588712
Have you tried using the code behind to handle these values rather than trying to stuff them all in a session variable?