Dictionary in Global.asa

Results 1 to 3 of 3

Thread: Dictionary in Global.asa

  1. #1
    Curtis Guest

    Default Dictionary in Global.asa

    I can&#039;t seem to get my dictionary object to work.<BR>In the session_onStart, I have this:<BR> Set Session("objDic") = Server.CreateObject("Scripting.Dictionary")<BR> Session("objDic").add "Var1","Apples"<BR> Session("objDic").add "Var2","Oranges"<BR> Session("objDic").add "Var3","Banannas" <BR><BR>I call it in code like this:<BR> if Session("objDic").exists(fruit1) and Session("objDic").exists(fruit2) then<BR> Response.Redirect"Order.asp"<BR> else<BR> Response.Redirect"Type.htm"<BR> end if<BR>When I try to call this object from an asp page, I keep getting &#039;Object Required&#039; errors. Why?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Dictionary in Global.asa

    You probably want to Set an object variable to reference the dictionary first.<BR><BR>Well, actually what you REALLY want to do is rethink this, because the Dictionary object is not thread-safe for use in Session scope. BAAAD scalability problems down that road...<BR><BR>Dunc

  3. #3
    Curtis Guest

    Default RE: Dictionary in Global.asa

    do you mean like:<BR>dim d<BR> Set Session("objDic") = Server.CreateObject("Scripting.Dictionary")<BR> d = Session("objDic")<BR><BR>its not for a big application or anything, I&#039;m just trying to learn how the dictionary object works.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts