I am very new to asp classic application. The below code snippet is from a asp classic application which we are going to migrate to Windows Server 2008RC.
1.Set objConfig_Constantsinc = Server.CreateObject("Notion.Configuration")
2.Dim account
3.account = objConfig_Constantsinc.GetConfig("SQLAccount")
As per my understanding in line number 1 we are creating an instance of a COM class. Now in line number 3 using this instance we are trying to get some config data “SQLAccount” .
Here is my doubt. In classic ASP application where are we storing these type of configuration strings(For eg: “SQLAccount”). Is there any concept of global configuration file. Kindly guide me.
As stated in the comments & by yourself, the Notion.Configuration item is some kind of com object, if you’re porting this to the new server you dont really have a problem (assuming you port the underlying storage mechanism, i.e. the com object could be storing the vars anywhere (Eg: sql, registry, files)
If for some reason you want to do away with the com object for storing configuration data (i.e. your question regarding the existence of a global configuration file) – there is a mechanism for doing this in Classic ASP.
Specifically, the global.asa file, commonly, the common.asa file is placed in the root of your site and exposes application variables that can be read from any asp file within your application.
More Details: http://msdn.microsoft.com/en-us/library/ms525316(v=vs.90).aspx
Declaring application level globals is easy:
Example from a global.asa:
Example in any other asp page:
I would remind you though, that declaring unnecessary global vars is counterproductive & you should carefully choose what to expose at a global level to avoid confusion / duplicate items in memory.