global.asa not execute

G

Guest

my global.asa file doesn't seem to be executing in IIS
and i don't know how to make them run. Any ideas how to
execute the global.asa file in IIS 5.1 , please let me
know. thank you very much.
 
J

James Bond

Hello Aaron and all,

I am replying to this, coz, my question is related to Global.asa.
I can get that to run, but here is my scenario. We have multiple apps
with their own Global.asa files, but connecting to same database and
using same Error Routines, CleanUp etc. So I thought to consolidate
them using following.

One SetUp file, which will set all variables ( appsetup.asp )
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
strUser = Request.ServerVariables("LOGON_USER")
strPath = Request.ServerVariables("LOGON_USER")
strDBStr = "Production" ( Or Devlopement etc... )
....
</SCRIPT>

Second File which has functions or subs for connection, error display
etc...
( appfunctions.asp )

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Function ConnectToDB(DBName)
objConn.Open ( Connection String )
End Function

Sub ShowError(errMsg, errNo, customMsg )
..... some gaudy HTML output
End Sub

</SCRIPT>

Now in Global.asa for each apps...

<!-- #include file = "common/appsetup.asp" -->
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
App_OnStart...
App_OnEnd ...

Sub Session_OnStart
</SCRIPT>
<!-- #include file = "common/appfunctions.asp" -->
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
ConnectToDB ( NorthWind )
some SQL operations to create session vars.

CleanUp
</SCRIPT>

My problem is....
In the function ( ConnectToDB ) or any Sub, I cannot access the
variables that I set for, those are common for all apps.
What am I missing here ?? Idea behind this is to keep it all at one
place, so it can be easily configurable.

Can anyone please help me on this ?
Thanks,
Snehal
 
J

James Bond

Sorry... The correct version with switched Include files...

Hello Aaron and all,

I am replying to this, coz, my question is related to Global.asa.
I can get that to run, but here is my scenario. We have multiple apps
with their own Global.asa files, but connecting to same database and
using same Error Routines, CleanUp etc. So I thought to consolidate
them using following.

One SetUp file, which will set all variables ( appsetup.asp )
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
strUser = Request.ServerVariables("LOGON_USER")
strPath = Request.ServerVariables("LOGON_USER")
strDBStr = "Production" ( Or Devlopement etc... )
....
</SCRIPT>

Second File which has functions or subs for connection, error display
etc...
( appfunctions.asp )

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Function ConnectToDB(DBName)
objConn.Open ( Connection String )
End Function

Sub ShowError(errMsg, errNo, customMsg )
..... some gaudy HTML output
End Sub

</SCRIPT>

Now in Global.asa for each apps...

<!-- #include file = "common/appfunctions.asp" -->
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
App_OnStart...
App_OnEnd ...

Sub Session_OnStart
</SCRIPT>
<!-- #include file = "common/appsetup.asp" -->
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
ConnectToDB ( NorthWind )
some SQL operations to create session vars.

CleanUp
</SCRIPT>

My problem is....
In the function ( ConnectToDB ) or any Sub, I cannot access the
variables that I set for, those are common for all apps.
What am I missing here ?? Idea behind this is to keep it all at one
place, so it can be easily configurable.

Can anyone please help me on this ?
Thanks,
Snehal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top