Some other Stuff
You can also have objects created in a
different way - with <object> tags:
<object
id="objRS" RUNAT="Server" SCOPE="Session" Progid="ADODB.RecordSet"></object>
<object id="objCnt"
RUNAT="server" Scope="Application" ProgID="MSWC.Counters"></object>
<script language="VBScript" RUNAT="SERVER">
...
</script> |
You can also use the ClassID in the ProgID
property (if known).
Some uses of this include -
- Storing a parsed XML file in
application/session variables for quick access later in the site.
- Having an open Database connection (be
careful with this one).
- Having a recordset open on every session.
- Put/check cookies on the user and validate
them for the rest of the site.
You should be careful of storing big objects in
these variables as they could get very large. eg. If each session got an
ADODB.Connection object to a database and kept that throughout the visit, with
increasing amounts of visitors, this could have big strains on the database
and your server. Its best to store things in smaller parts, eg. Load up an xml
file and filter it for the information you want, you may want to store the
whole object if its not too big, or store it as an application variable.
Its better to store objects as application
variables because there will only be one of them.