Saving a two dimensional array into the session

Posted on 2005-05-03
Last Modified: 2008-02-01
I am leaving out some parts here, but the gist ie here.  I have a 2 dimensional array called questionArray that I am populating through a nested looped query not included below.  

<%DIM questionArray(24,5)


Dim test(24,5)
test =session("questions")%> // Line Error is On

I get this error on the commented line above:

Microsoft VBScript runtime error '800a000d'

Type mismatch

/unfquiz/index.asp, line 55

How can this be if I am setting the session array to the new array and they both have the same dimensions?
Question by:gdlp2004
    LVL 4

    Expert Comment

    I didn't think you could dump arrays into a session variable like that... You might be better concaternating it into a string first, with commas or semicolons seperating it, then use the split command to turn it back into an array when you pull it out of the session variable.
    LVL 15

    Accepted Solution

    You certainly can store array's in Session variables. So no problem there.

    I would try NOT declaring the dimensions of the array when you read it back from the Session variable.

    So rather than:

    Dim test(24,5)
    test =session("questions")%


    Dim test
    test =session("questions")%

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now