M
Matt Calhoon
Hi there,
How does IIS 6.0 treat the global.asa file? I had the following problem;
1. uploaded a new site to the win3k server
2. had incorrect db connection string in Session_OnStart in global.asa and
website caused errors.
3. Changed the global.asa file to include the correct details. Saved the
file. Still got the same errors.
I could not resolve this unless restarting the WWW Service on this server.
In IIS 5.0 the global.asa file would reload after resaving it (as the
timestamp is updated).
I even waited the next day before restarting the service because I though
Session_OnStart expires after my session ends...but the error was still there
in the morning.
Hopefully someone will make sense of it for me. Here is the code (I
inherited) in the global.asa
Sub Application_OnStart
Application("DB.ConnectionString") = ""
Application("MaxLoginAttempts") = 5
Set Application("Con") = Server.CreateObject("ADODB.Connection")
Session("Test") = Now()
End Sub
Sub Session_OnStart
Application("DB_ConnectionString") = "Provider=SQLOLEDB; Data
Source=myDBServer; Initial Catalog=DatabaseName; User ID=sa;
Password=mypassword"
'changed db connection application var to SQL server
Session("LoginAttempts") = 0
Session("XAN_ConnectionString") = Application("DB_ConnectionString")
Session("XAN_adminConnectionString") = Application("DB_ConnectionString")
Session("XAN_ConnectionTimeout") = 15
Session("XAN_CommandTimeout") = 30
Session("XAN_CursorLocation") = 3
Set Session("Con") = Server.CreateObject("ADODB.Connection")
Session("Con").ConnectionTimeout = Session("XAN_ConnectionTimeout")
Session("Con").CommandTimeout = Session("XAN_CommandTimeout")
Session("XAN_ConnectionString") = "Provider=SQLOLEDB; Data
Source=myDBServer; Initial Catalog=DatabaseName; User ID=sa;
Password=mypassword"
Response.Buffer = true
if Application("Con").State = 0 then
Application("Con").Open Session("XAN_ConnectionString")
end if
'*********************************************************************************
End Sub
How does IIS 6.0 treat the global.asa file? I had the following problem;
1. uploaded a new site to the win3k server
2. had incorrect db connection string in Session_OnStart in global.asa and
website caused errors.
3. Changed the global.asa file to include the correct details. Saved the
file. Still got the same errors.
I could not resolve this unless restarting the WWW Service on this server.
In IIS 5.0 the global.asa file would reload after resaving it (as the
timestamp is updated).
I even waited the next day before restarting the service because I though
Session_OnStart expires after my session ends...but the error was still there
in the morning.
Hopefully someone will make sense of it for me. Here is the code (I
inherited) in the global.asa
Sub Application_OnStart
Application("DB.ConnectionString") = ""
Application("MaxLoginAttempts") = 5
Set Application("Con") = Server.CreateObject("ADODB.Connection")
Session("Test") = Now()
End Sub
Sub Session_OnStart
Application("DB_ConnectionString") = "Provider=SQLOLEDB; Data
Source=myDBServer; Initial Catalog=DatabaseName; User ID=sa;
Password=mypassword"
'changed db connection application var to SQL server
Session("LoginAttempts") = 0
Session("XAN_ConnectionString") = Application("DB_ConnectionString")
Session("XAN_adminConnectionString") = Application("DB_ConnectionString")
Session("XAN_ConnectionTimeout") = 15
Session("XAN_CommandTimeout") = 30
Session("XAN_CursorLocation") = 3
Set Session("Con") = Server.CreateObject("ADODB.Connection")
Session("Con").ConnectionTimeout = Session("XAN_ConnectionTimeout")
Session("Con").CommandTimeout = Session("XAN_CommandTimeout")
Session("XAN_ConnectionString") = "Provider=SQLOLEDB; Data
Source=myDBServer; Initial Catalog=DatabaseName; User ID=sa;
Password=mypassword"
Response.Buffer = true
if Application("Con").State = 0 then
Application("Con").Open Session("XAN_ConnectionString")
end if
'*********************************************************************************
End Sub