%
function GetDBConnection ( szConnectionString )
{
try
{
var g_DBConn = new ActiveXObject( "ADODB.Connection" );
g_DBConn.CommandTimeout=240;
g_DBConn.ConnectionTimeout = 235;
try
{
g_DBConn.Open( szConnectionString );
}
catch( err )
{
return false;
}
}
catch ( err )
{
return false;
}
return g_DBConn;
}
function ExecuteSP( Query, SP )
{
if( typeof( g_DBConn ) == "undefined" )
g_DBConn = GetDBConnection( Application("CRASHDB3" ) )
else if ( g_DBConn == null )
g_DBConn = GetDBConnection( Application("CRASHDB3" ) )
try
{
var rsRecordSet = g_DBConn.Execute( Query )
return rsRecordSet
}
catch ( err )
{
Response.Write( "Could not execute " + SP + "(...)
" )
Response.Write( "Query: " + Query + "
" )
Response.Write( "[" + err.number + "] " + err.description )
Response.End
}
}
//set this to 1 for a debug build or true
var DebugBuild = 1
var DataSource = "test"
/*
//Set this for the DB access: (case sensitive)
// test -bsod_db1
// live -tkwucdsqla01
// replicated -Replicated Data
// or use the constants below
var TEST = new String("test")
var LIVE = new String("live")
var REPLICATED = new String("replicated")
var DataSource = REPLICATED.toString()
if ( String(Application("DataSource")) == "undefined" )
Application("DataSource") = DataSource //.toString()
if ( DataSource != Application("DataSource") )
{
DataSource = Application("DataSource")
}
// WARNING: KLUDGE (a-mattk)
DataSource = TEST.toString()
if ( DebugBuild == 0 )
{
if ( Application("DebugBuild") == 1 )
DebugBuild = 1
else
DebugBuild = 0
}
if ( DataSource == TEST )
{
var g_DBConnStrings = {
//"DBGPORTAL" : "Driver=SQL Server;Server=scpsd;uid=sa;pwd=GoWin;DATABASE=dbgportal"
//these are for test database
//"SEP_DB" : "Driver=SQL Server;Server=bsod_db1;uid=sa;pwd=bsoddb1!;DATABASE=Solutions3",
"SEP_DB" : "Driver=SQL Server;Server=redbgitsql13;uid=newsa;pwd=81574113;DATABASE=Solutions3",
"CRASHDB" : "Driver=SQL Server;Server=redbgitsql13;uid=newsa;pwd=81574113;DATABASE=crashdb3",
"TKOFF" : "Driver=SQL Server;Server=TKOFFDWSQL02;DATABASE=DWInternal;uid=dwsqlrw;pwd=am12Bzqt"
}
//Response.Write("