[thelist] ASP/ADO/SQL: Is it Possible to Store a Recordset in an Application Variable?

James Aylard webmaster at equilon-mrc.com
Tue May 22 18:13:38 CDT 2001


Matt,

> Try this:
>
> set objRecordset = Application("myrecordset")

    That was my initial effort. But I get errors in my ASP page saying that
the object is closed. BTW, I am deriving my recordset by using the Execute
method of the Command object (partly because I am passing a parameter into
my stored procedure). Of the various ways to extract a recordset via ADO, is
there a better one that I should be using?

> Not to plug my own article or anything (becuase it could be a lot
> better  ;-), but try looking at this:
>
> http://www.evolt.org/article/ASP_Application_level_HTML_Caching/17/621
> /index.html

    It's a good article. :) Although it only touches briefly, in the last
paragraph, on caching database chunks in Application variables --
tantalizing, but not much detail on that point.

> Basically, what I would do (if you can) is create the display of the
> data in the recordset and store *that* in an application variable.
> Or, spit the recordset into something lighter like an array:
...
> Storing the recordset in the Application object is generally not a
> Good Thing(tm) and if you can avoid it, avoid it. ;-)

    Would a disconnected recordset qualify? I certainly don't want to leave
a database connection open, but a disconnected recordset would seem to avoid
that.
    Thanks.

James Aylard





More information about the thelist mailing list