
Help! Storing Arrays in Session Variables - problem
I have an ASP script in which I'm loading an array called "arrRATES1" from a
database, then storing this array in a Session variable so that the database
doesn't need to be accessed each time the user refreshes.
I am trying this the same way the example in "Professional Active Server
Pages 2.0"
does it (p.333); it seems to place the array into the session variable o.k.,
but when I
refresh the page and it tries the reverse, it bombs with:
Quote:
>--8
Microsoft
VBScript runtime error '800a000d'
Type mismatch
/Function_library_us.vjp.asp, line 620 "
Quote:
>--8
This is the code, with the offending line noted:
Quote:
>--8
'Load annuity table array ONLY first time through:
if session("tables_loaded") = false then
call LOAD_RATES1_TABLE
session("StoredRATES1") = arrRATES1
session("tables_loaded") = true
else
arrRATES1 = session("StoredRATES1")
<------- line 620
end if
Quote:
>--8
....any ideas? arrRATES1 is dimensioned (n,4) where n = the number of rows
retrieved from the table.
If is DIM'med at the beginning of the script with "dim arrRATES1()", and
REDIM'med in the LOAD_RATES1_TABLE
sub with "redim arrRATES1(n,4)". Could the two-dimensional aspect be
causing this problem?
Thanks for any help......