Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Function?? 1

Status
Not open for further replies.

SqueakinSweep

Programmer
Jun 20, 2002
945
GB
Im looking at a bit of script code, which has me puzzled as to where the return value comes from. The client end is IE5, and the server is W2K running IIS with a registered VB bespoke DLL named clsADO.DLL , for returning and handling record sets. I know the name of the DLL, as it is referenced in some ASP pages but not all, but it is also referenced in the following way.

oAdo = CREATEOBJECT(Application("DLL")) is the same as
oAdo = CREATEOBJECT("clsAdo.Ado")

Im puzzled as to where I should look to find where this Application() function returns the name of the correct DLL.

Can anyone point me in the right direction, or at least point me to some documentation about the Application() function/method
 
This is really an ASP question and ought to be in the ASP Forum. The short answer of course is RTFM.

But... the Application object is a standard part of ASP, and just like the Session object can be used to cache data in "application variables."

The default property of these objects is the collection Contents and so the syntax probably should look like Application.Contents(key ) but nobody ever uses it like that.

Things like connection strings that are identical (or intended to be) throughout an ASP application really should be placed into this collection during the Application_OnStart event in global.asa because the biggest enemy of database connection pooling is slight variations in connection string syntax throughout an application (or across multiple applications for that matter). Putting the string into
Code:
Application("dbConnStr")
once and referencing that in each ASP page ensures that you use the very same connection string each time.

I'm not sure why somebody would store a progID in Application.Contents this way, but it doesn't hurt. If you are going to do that it makes sense for all uses of the progID to fetch it from there though.

ASP is the "sloppy hack heaven" of web development, attracting some of the scariest people. It is disturbing how often things like your situation crop up. It's a crime how many people build ASP applications with no global.asa at all, still using things like the long-deprecated include.vbs. Even worse are pages that fail if VBScript's Option Explicit is added (though this should have been the default and unalterable - *sigh*). But I digress editorially... I've been fixing too many messed up ASP pages lately I guess.

Hope this answers your question. More info can be found at:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top