Hermes wrote:
Hi All,
Is there a way of performing an sql query and then call it again from
memory rather than having to execute the query again?
As We have a few pages which gets data from a long query but then
depending on user interaction could get recalled several times but
with the data still the same.
Kind regards,
Hermes
You can store your data in a session variable by using Getrows to convert
your recordset to an array and setting the array to a session variable. Like
this:
dim arData
'open your recordset, then
if not rs.eof then arData = rs.GetRows
rs.close:set rs=nothing
'close and destroy your connection here as well
if isArray(arData) then
Session("data") = arData
else
Session("data") = "no data"
end if
Then, in a subsequent page:
dim arData
arData = Session("data")
if isArray(arData) then
'work with the data in the array.
end if
Search for the keyword GetRows at
www.aspfaq.com to see some examples of
working with the data in a GetRows array.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"