Link to home
Start Free TrialLog in
Avatar of Suneesh
Suneesh

asked on

Session object error 'ASP 0185 : 8002000e'

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
     Sub Session_OnStart
          session("key") = 1
          dim dirDictionaryf
          set dirDictionary =server.CreateObject("Scripting.Dictionary")
          session("kk")=dirDictionary
           
     end Sub
</SCRIPT>

this code is writing on global.asa file.

But it showing an error which is given below


Session object error 'ASP 0185 : 8002000e'

Missing Default Property

A default property was not found for the object.

Any body can help me





Avatar of Suneesh
Suneesh

ASKER

<OBJECT RUNAT="Server" SCOPE="Session" ID="dirDictionary"
PROGID="Scripting.Dictionary"></OBJECT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
     Sub Session_OnStart
          session("key") = 1
          set("kk")=dirDictionary
           
     end Sub
</SCRIPT>


I tried this way also.The same error coming there also
suneesh -- I can't tell you what the problem is, but I can tell you this: you should definately not be storing a dictionary object in particular, but more generally any object at all, in the session object.

the dictionary object in particular bad to stuff into session; I will look for the MS Q that describes why. in general, objects in session will hang your IIS in a multi-user envrinronemt; it has to do with threading and you're tempting fate if you try it.

if you describe why you are trying to put a dictionary here, i or someone else may be able to suggest alternatives.

c
ASKER CERTIFIED SOLUTION
Avatar of hongjun
hongjun
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As hongjun told it's not advisable to store any objects in session.

Just I tell you what's wrong with your code

What you did in the second posting is correct.

<OBJECT RUNAT="Server" SCOPE="Session" ID="dirDictionary" PROGID="Scripting.Dictionary"></OBJECT>

Here you already defined the dictionary object with session scope, then why are you again trying to store it in a session variable like:

set("kk")=dirDictionary

You don?t need this.

You can just access this dictionary object by it?s name in any page  like:

dirDictionary.Add ?key?, ?value?

In the first posting you have to do like:
Set session("kk")=dirDictionary

Avatar of Suneesh

ASKER

Thanks for ur valuable advice MCM,Hongjun and Bahu M
This question is still open.
Don't forhet to grade this question if you accept a comment for an answer.

Bye

Rem
Please accept 1 answer!

hongjun
This abandonded question will be graded and split 3 ways, I will reduce the points here to 25 to allow for the split.

I will accept hongjun here and create new questions for the other two Experts.

25=hongjun
25=MCM
25=bahu_m

Thank you,
ComTech
Community Support Moderator