G
Guest
I have a subroutine called Sub Application_BeginRequest. It is in my
Global.asax.vb file. It seems to be called when the application is
launched, but I am not sure how. i thought somewhere in code you have to
actually use the Application_BeginRequest() parameter to invoke the
subroutine. Or is this some built in thing that if you name something
Application_beginRequest, the engine knows to use this sub routine?
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
gsDataSource = ";Data Source = "
Dim sApplPhysicalPath As String =
Request.ServerVariables("APPL_PHYSICAL_PATH")
Dim sDataRelPath As String = "..\data\data.mdb"
gsDataSource += sApplPhysicalPath & sDataRelPath
Dim sServerName As String =
LCase(Trim(Request.ServerVariables("SERVER_NAME")))
' This line use to read If sServerName = "www.pointe.com" Then
If sServerName = "graddb.bgt.matown.edu/bt/dev" Then
'Dim sPathInfo As String =
LCase(Trim(Request.ServerVariables("PATH_INFO")))
'Dim sDir As String = Left(sPathInfo, InStrRev(sPathInfo, "/"))
'If sDir = "/bt/dev/" Then
gbDevelopment = True
'gsDataSource += sApplPhysicalPath & "..\" & sDataRelPath
' removed an end if statement
Else
' This use to read gbDevelopment = True
gbDevelopment = False
End If
'These lines use to read
'If gbSQLServer Then
'sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\w\btmsm\bt.mdb"
'gsConnectionString = "Provider=SQLOLEDB;Data Source=ccm4;Initial
Catalog=BTMSM;Integrated Security=SSPI"
'Else
'If gbDevelopment Then
'gsConnectionString = OLEDB_PROVIDER & "User
ID=gtmbatestdb;Password=" & ADMIN_PASSWORD & ";Data Source=point"
'Else
'gsConnectionString = OLEDB_PROVIDER & "User ID=ctmsm;Password=" &
ADMIN_PASSWORD & ";Data Source=point"
'End If
' For Production, use different password and use mprod.cgt.bt.buzz
' For Development use mdevl.mgt.gt.buzz
If gbDevelopment Then
gsConnectionString = OLEDB_PROVIDER & "User ID=ctmba;Password="
& DB_PASSWORD & ";Data Source=mdevl.cgt.bt.buzz"
Else
' The end of this string use to read DB_PASSWORD and
mdevl.cgt.bt.buzz
gsConnectionString = OLEDB_PROVIDER & "User ID=ctmba;Password="
& DB_PASSWORD1 & ";Data Source=mprod.cgt.bt.buzz"
End If
End Sub
Global.asax.vb file. It seems to be called when the application is
launched, but I am not sure how. i thought somewhere in code you have to
actually use the Application_BeginRequest() parameter to invoke the
subroutine. Or is this some built in thing that if you name something
Application_beginRequest, the engine knows to use this sub routine?
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
gsDataSource = ";Data Source = "
Dim sApplPhysicalPath As String =
Request.ServerVariables("APPL_PHYSICAL_PATH")
Dim sDataRelPath As String = "..\data\data.mdb"
gsDataSource += sApplPhysicalPath & sDataRelPath
Dim sServerName As String =
LCase(Trim(Request.ServerVariables("SERVER_NAME")))
' This line use to read If sServerName = "www.pointe.com" Then
If sServerName = "graddb.bgt.matown.edu/bt/dev" Then
'Dim sPathInfo As String =
LCase(Trim(Request.ServerVariables("PATH_INFO")))
'Dim sDir As String = Left(sPathInfo, InStrRev(sPathInfo, "/"))
'If sDir = "/bt/dev/" Then
gbDevelopment = True
'gsDataSource += sApplPhysicalPath & "..\" & sDataRelPath
' removed an end if statement
Else
' This use to read gbDevelopment = True
gbDevelopment = False
End If
'These lines use to read
'If gbSQLServer Then
'sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\w\btmsm\bt.mdb"
'gsConnectionString = "Provider=SQLOLEDB;Data Source=ccm4;Initial
Catalog=BTMSM;Integrated Security=SSPI"
'Else
'If gbDevelopment Then
'gsConnectionString = OLEDB_PROVIDER & "User
ID=gtmbatestdb;Password=" & ADMIN_PASSWORD & ";Data Source=point"
'Else
'gsConnectionString = OLEDB_PROVIDER & "User ID=ctmsm;Password=" &
ADMIN_PASSWORD & ";Data Source=point"
'End If
' For Production, use different password and use mprod.cgt.bt.buzz
' For Development use mdevl.mgt.gt.buzz
If gbDevelopment Then
gsConnectionString = OLEDB_PROVIDER & "User ID=ctmba;Password="
& DB_PASSWORD & ";Data Source=mdevl.cgt.bt.buzz"
Else
' The end of this string use to read DB_PASSWORD and
mdevl.cgt.bt.buzz
gsConnectionString = OLEDB_PROVIDER & "User ID=ctmba;Password="
& DB_PASSWORD1 & ";Data Source=mprod.cgt.bt.buzz"
End If
End Sub