if not rs.eof then
minYear = 2099
maxYear = 0
dim years(2010) ' how high?
' ...
do while not rs.eof
if minYear > rs("year") then minYear = rs("year")
if maxYear < rs("year") then maxYear = rs("year")
years(rs("year")) = True
rs.movenext
loop
session("minYear") = minYear
session("maxYear") = maxYear
session("years") = years
end if
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Jas" <no****@nomail.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
can you give an example aaron
thanks
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl... Ugh, why? Use an array.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Jas" <no****@nomail.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl... Hi All
I guess I should just have tried this to see if it works but I don't have access to a machine running IIS and can't test it and I am itching for an answer.
I want to use dynamic variable names in one of my pages.
I store a field called year in one of my table. For each year I want
to create a session variable for that year name perhaphs like the code below.
While not rs.eof
strVarId = strVarId & rs("year")
session(strVarId) = True
rs.movenext
Wend
the value in the recordset will be
2002
2003
2004
2005
hence I want 4 session variables like
strVarId2002
strVarId2003
strVarId2004
strVarId2005
Will this work?
Thanks
Jas