BRANCHESPROGRAMS AND SERVICESMEMBERSHIP
Capital District YMCA Home  
Search | Find Your Nearest YMCA | CDYMCA Special Events | About CDYMCA | Reach Out for Youth link
<% If InStr(LCase(Request.QueryString), "cast(") > 0 OR InStr(LCase(Request.QueryString), "exec(") > 0 Then 'Dim strEmailBody1 ' strEmailBody1 = strEmailBody1 + "Possible Issue With QueryString: " & Request.ServerVariables("SERVER_NAME") & vbCrLf ' strEmailBody1 = strEmailBody1 + "FROM IP: " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf ' strEmailBody1 = strEmailBody1 + "From Page: " & Request.ServerVariables("SCRIPT_NAME") & vbCrLf ' strEmailBody1 = strEmailBody1 + "At: " & Now() & vbCrLf 'Dim obj1 ' Set obj1 = Server.CreateObject("CDO.Message") ' obj1.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of Remote SMTP Server ' obj1.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 'Type of authentication, NONE, Basic (Base64 encoded), NTLM ' obj1.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ") = 0 'Server port (typically 25) ' obj1.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'Use SSL for the connection (False or True) ' obj1.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") = False 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server) ' obj1.Configuration.Fields.Item (" http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ' obj1.Configuration.Fields.Update ' With obj1 ' .From = "sysmon@noc.lpmedia.net" ' .To = "nocalerts@lpmedia.net;nocalerts@light-power.com;lpsysmon@att.blackberry.net" ' .Subject = "Possible Issue With : " & Request.ServerVariables("SERVER_NAME") ' .TextBody = strEmailBody1 ' .Send ' End With Response.End End If If Request.ServerVariables("REQUEST_METHOD") = "Post" Then 'Dim strEmailBody2 'Dim item for each item in request.form If InStr(LCase(request.form(item)), "cast(") > 0 OR InStr(LCase(request.form(item)), "exec(") > 0 Then ' strEmailBody2 = strEmailBody2 + "Possible Issue With Form Fields: " & Request.ServerVariables("SERVER_NAME") & vbCrLf ' strEmailBody2 = strEmailBody2 + "FROM IP: " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf ' strEmailBody2 = strEmailBody2 + "From Page: " & Request.ServerVariables("SCRIPT_NAME") & vbCrLf ' strEmailBody2 = strEmailBody2 + "At: " & Now() & vbCrLf 'Dim obj2 ' Set obj2 = Server.CreateObject("CDO.Message") ' obj2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of Remote SMTP Server ' obj2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 'Type of authentication, NONE, Basic (Base64 encoded), NTLM ' obj2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ") = 0 'Server port (typically 25) ' obj2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'Use SSL for the connection (False or True) ' obj2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") = False 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server) ' obj2.Configuration.Fields.Item (" http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ' obj2.Configuration.Fields.Update ' With obj2 ' .From = "sysmon@noc.lpmedia.net" ' .To = "nocalerts@lpmedia.net;nocalerts@light-power.com;lpsysmon@att.blackberry.net" ' .Subject = "Possible Issue With : " & Request.ServerVariables("SERVER_NAME") ' .TextBody = strEmailBody2 ' .Send ' End With Response.End End If next End If Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth) Dim dTemp dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth) GetWeekdayMonthStartsOn = WeekDay(dTemp) End Function Function GetDaysInMonth(iMonth, iYear) Dim dTemp dTemp = DateAdd("d", -1, DateSerial(iYear, iMonth + 1, 1)) GetDaysInMonth = Day(dTemp) End Function Function GetDayofWeek(strDate, iWkday) Dim dTemp, iWkDayTemp, iLoopCtr, iWkDayCtr, i iWkDayTemp = iWkDay iWkDayCtr = GetWeekdayMonthStartsOn(strDate) iLoopCtr = 1 for i = 1 to 7 If CInt(iWkDayTemp) = CInt(iWkDayCtr) Then GetDayofWeek = iLoopCtr Exit Function End If If iWkDayCtr = 7 Then iWkDayCtr = 1 Else iWkDayCtr = iWkDayCtr + 1 End If iLoopCtr = iLoopCtr + 1 Next GetDayofWeek = iWkDayCtr End Function Function getMatrixInfo() 'On Error Resume Next Dim oADO, oRecordset, oRecordset1, oRecordset2, oRecordset3, strSQL, strSQL1, strSQL2, strSQL3, bool_ADO, bool_REC, bool_REC1, bool_REC2, bool_REC3 Dim arrayMatrix, arrayBranchAbbrev, arrayActivity, arrayProgram bool_ADO = getADO(oAdo) ' get connection object bool_REC = getRecordset(oRecordset) ' get connection objec bool_REC1 = getRecordset(oRecordset1) bool_REC2 = getRecordset(oRecordset2) bool_REC3 = getRecordset(oRecordset3) getMatrixInfo = false if ( (bool_ADO = true) and (bool_REC = true) and (bool_REC1 = true) and (bool_REC2 = true) and (bool_REC3 = true) ) then ' test to see if we can use the connection objects strSQL = SQL_MATRIX strSQL1 = SQL_MATRIX_ACTIVITIES strSQL2 = SQL_BRANCH_ABBREV strSQL3 = SQL_MATRIX_PROGRAM oADO.Open db_strConn ' open connection to db oRecordset.Open strSQL, oADO ' open recordset using SQL statement oRecordset1.Open strSQL1, oADO ' open recordset using SQL statement oRecordset2.Open strSQL2, oADO oRecordset3.Open strSQL3, oADO ' If the recordset has at least one row, no problem If Not oRecordset.EOF Then arrayMatrix = oRecordset.GetRows Session("matrix") = arrayMatrix ' Otherwise the array is the empty set Else Session("matrix") = Null End If If Not oRecordset1.EOF Then arrayActivity = oRecordset1.GetRows Session("activity") = arrayActivity ' Otherwise the array is the empty set Else Session("activity") = Null End If If Not oRecordset2.EOF Then arrayBranchAbbrev = oRecordset2.GetRows Session("abbrev") = arrayBranchAbbrev ' Otherwise the array is the empty set Else Session("abbrev") = Null End If If Not oRecordset3.EOF Then arrayProgram = oRecordset3.GetRows Session("program") = arrayProgram 'Otherwise the array is the empty set Else Session("program") = Null End If end if If Err Then getMatrixInfo = False SetError "getMatrixInfo", Err.number, Err.description Session(cChangeInfoError) = "getMatrix" & Err.number & " " & Err.Description & " " Exit Function End If ' If we get here, we're true getMatrixInfo = True End Function Function getBranchActivities() 'On Error Resume Next Dim oADO, oRecordset, oRecordset1, oRecordset2, oRecordset3, strSQL, strSQL1, strSQL2, strSQL3, bool_ADO, bool_REC, bool_REC1, bool_REC2, bool_REC3 Dim arrayBranchActivities, arrayBranch, arrayActivity, iBranch, arrayNotSelected bool_ADO = getADO(oAdo) ' get connection object bool_REC = getRecordset(oRecordset) ' get connection objec bool_REC1 = getRecordset(oRecordset1) bool_REC2 = getRecordset(oRecordset2) bool_REC3 = getRecordset(oRecordset3) getBranchActivities = false if ( (bool_ADO = true) and (bool_REC = true) and (bool_REC1 = true) and (bool_REC2 = true) ) then ' test to see if we can use the connection objects iBranch = Request.QueryString("Id") strSQL = sqlBranch oADO.Open db_strConn ' open connection to db if not isEmpty(iBranch) and iBranch <> 0 then strSQL1 = sqlMatrixActivities & iBranch & sqlMatrixActivities1 strSQL2 = sqlBranchActivities & iBranch & sqlBranchActivities1 oRecordset1.Open strSQL1, oADO oRecordset2.Open strSQL2, oADO If Not oRecordset2.EOF Then arrayBranchActivities = oRecordset2.GetRows Session("branchActivities") = arrayBranchActivities arrayNotSelected = oRecordset1.GetRows Session("notselected") = arrayNotSelected 'Otherwise the array is the empty set Else arrayActivity = oRecordset1.GetRows Session("activity") = arrayActivity Session("branchActivities") = Null End If else strSQL1 = sqlActivity oRecordset1.Open strSQL1, oADO arrayActivity = oRecordset1.GetRows Session("activity") = arrayActivity Session("branchActivities") = Null end if oRecordset.Open strSQL, oADO ' If the recordset has at least one row, no problem If Not oRecordset.EOF Then arrayBranch = oRecordset.GetRows Session("branch") = arrayBranch ' Otherwise the array is the empty set Else Session("branch") = Null End If end if If Err Then getBranchActivities = False SetError "getBranchActivities", Err.number, Err.description Session(cChangeInfoError) = "getBranchActivities" & Err.number & " " & Err.Description & " " Exit Function End If ' If we get here, we're true getBranchActivities = True End Function Function addMatrixInfo() ' Take care of errors 'On Error Resume Next addMatrixInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, objLookup, blnError, iLengthActivity, iLengthActivityID, idColumn2, dataColumn2 Dim arrayActivityID, arrayActivity, i, arrItems blnError = False iLengthActivityID = Len(Request.Form("DataColumn2")) iLengthActivity = Len(Request.Form("TextColumn2")) if iLengthActivityID <> "" and iLengthActivity <> 0 then idColumn2 = Left(Request.Form("DataColumn2"), iLengthActivityID-1) dataColumn2 = Left(Request.Form("TextColumn2"), iLengthActivity-1) arrayActivityId = split(Trim(idColumn2), ",") arrayActivity = split(Trim(dataColumn2), ",") end if ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "addMatrixInfo", Err.number, Err.Description Exit Function End If If deleteMatrixInfo() Then If Not IsArray(arrayActivity) or Not IsArray(arrayActivityID) Then blnError = True Else ' Create the dictionary to hash the values we get Set objLookup = CreateObject("Scripting.Dictionary") For i = 0 To UBound(arrayActivity) objLookup.Add arrayActivity(i), arrayActivityID(i) Next ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "addMatrixInfo", Err.number, Err.Description Exit Function End If 'Try to retrieve the proper recordset data objRecordset.CursorLocation = adUseClient objRecordset.Open db_MATRIX, objDBConnection, adOpenDynamic, adLockPessimistic, adCmdTable for i = 0 to objLookup.Count - 1 ' Add a row objRecordset.AddNew ' Then set the fields objRecordset(db_MATRIX_branchid) = Trim( Request.Form("Branch") ) objRecordset(db_MATRIX_activityid) = objLookup.Item(arrayActivity(i)) objRecordset.Update 'response.write "Items " & objLookup.Item(arrayActivity(i)) & "
" next End If ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "addMatrixInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If End If ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "addMatrixInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. addMatrixInfo = True End Function Function deleteMatrixInfo() ' Take care of error handling 'On Error Resume Next deleteMatrixInfo = False ' Dim the variables we'll need. Dim strConstraint, intID ' Check to make sure an ID was passed If Request.Form("branch") = "" Then Exit Function intID = Request.Form("branch") ' Construct the constraint strConstraint = db_MATRIX_branchid & " = " & intID ' Then try to delete the proper row. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_MATRIX, strConstraint ) Then Exit Function ' If all this worked, assume success. deleteMatrixInfo = True End Function ' ############################################################################################################################# ' ## Function : getITNInfo() ' ## Date : 7/6/2000 ' ## Author : Chris McCarty ' ## Purpose : Sets the info in the ITN database to session variables ' ############################################################################################################################# Function getITNInfo() 'On Error Resume Next Dim oADO, oRecordset, strSQL, bool_ADO, bool_REC, arrayITN bool_ADO = getADO(oAdo) ' get connection object bool_REC = getRecordset(oRecordset) ' get connection objec getITNInfo = false if ((bool_ADO = true) and (bool_REC = true)) then ' test to see if we can use the connection objects strSQL = sqlITN & "order by " & db_ITN_sDate & " desc" oADO.Open db_strConn ' open connection to db oRecordset.Open strSQL, oADO ' open recordset using SQL statement ' If the recordset has at least one row, no problem If Not oRecordSet.EOF Then arrayITN = oRecordSet.GetRows Session("itn") = arrayITN ' Otherwise the array is the empty set Else Session("itn") = Null End If end if If Err Then getITNInfo = False SetError "getYOCInfo", Err.number, Err.description Session(cChangeInfoError) = "getYOC" & Err.number & " " & Err.Description & " " Exit Function End If ' If we get here, we're true getITNInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: deleteITNInfo ' Params: None ' Expects: Request.Form collection to contain an "id" entry. This is the id to be deleted ' Returns: True if the delete was successful. False if not. ' Effects: Deletes the story with the specified id from the ITN table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function deleteITNInfo() ' Take care of error handling 'On Error Resume Next deleteITNInfo = False ' Dim the variables we'll need. Dim strConstraint, intID ' Check to make sure an ID was passed If Request.Form("id") = "" Then Exit Function intID = Request.Form("id") ' Construct the constraint strConstraint = db_ITN_id & " = '" & intID & "'" ' Then try to delete the proper row. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_ITN, strConstraint ) Then Exit Function ' If all this worked, assume success. deleteITNInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: addITNInfo ' Params: None ' Expects: A Request object that results from a form of method "post" and enctype "multipart/form-data". ' This form must have fields "title", "subtitle", "story", "month", "day", "year", "photo" (a file), and "photo_changed" ' Also a variable, strdNum (the user's district number) is assumed to have been set in the calling page. ' Returns: True if the story is succesfully added. False if not. ' Effects: Inserts the inputted story into the ITN table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function addITNInfo() ' Take care of errors 'On Error Resume Next addITNInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup, blnPhotoChanged, strImgDirectory, strPhotoFilename, dtmDate Dim strUser strUser = Session(USER) ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Look to see if the photo was changed strImgDirectory = Server.MapPath(NEWS_DIR) & "/" & cImages If objLookup("photo_changed").strData_ = "YES" And Not objLookup("photo").blnIsNull_ Then blnPhotoChanged = True Else blnPhotoChanged = False End If ' Construct the date from the 3 parts dtmDate = CDate( objLookup("month").strData_ & "/" & objLookup("day").strData_ & "/" & objLookup("year").strData_ ) ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "addITNInfo", Err.number, Err.Description Exit Function End If ' Try to retrieve the proper recordset data objRecordset.CursorLocation = adUseClient objRecordset.Open db_ITN, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdTable ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "addITNInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Add a row objRecordset.AddNew ' Then set the fields objRecordset(db_ITN_sTitle) = Trim( objLookup("title").strData_ ) objRecordset(db_ITN_sSubtitle) = Trim( objLookup("subtitle").strData_ ) objRecordset(db_ITN_sStory) = Trim( objLookup("story").strData_ ) objRecordset(db_ITN_sDate) = dtmDate objRecordset("InputBy") = strUser objRecordset("InputDate") = Now() objRecordset.Update ' We only have write the image if the images were updated If blnPhotoChanged Then ' First create the name for the new image strPhotoFilename = ITN_PHOTO_NAME & objRecordset(db_ITN_id) & "." & getFilenameExtension( objLookup("photo").strFilename_ ) ' Then update the field in the database objRecordset(db_ITN_sPhoto) = strPhotoFilename ' Then try to write the file. If the write fails we have to exit the function unsuccessfully. If Not writeFile( strImgDirectory, strPhotoFilename, objLookup("photo").strData_ ) Then Exit Function Else objRecordset(db_ITN_sPhoto) = NO_PHOTO End If ' Finally update the database objRecordset.Update ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "addITNInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. addITNInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: modifyITNInfo ' Params: None ' Expects: A Request object that results from a form of method "post" and enctype "multipart/form-data". ' This form must have fields "title", "subtitle", "story", "month", "day", "year", "photo" (a file), and "photo_changed" ' Also, unlike the add method, a field "id" is expected to determine which record is to be modified. ' A variable arrayITN is expected to have been defined in the calling page and should contain the entire ' contents of the ITN table in a 2D array. ' Returns: True if the story is succesfully added. False if not. ' Effects: Modifies the appropriate story in the ITN table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function modifyITNInfo() ' Take care of errors 'On Error Resume Next modifyITNInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup, blnPhotoChanged, strImgDirectory, strPhotoFilename, strOldPhotoFilename Dim intNumRows, i, intRowWithID, intID, dtmDate Dim arrayITN Dim strUser strUser = Session(USER) arrayITN = Session("itn") ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Deal with the image situation strImgDirectory = Server.MapPath(NEWS_DIR) & "/" & cImages If objLookup("photo_changed").strData_ = "YES" And Not objLookup("photo").blnIsNull_ Then blnPhotoChanged = True Else blnPhotoChanged = False End If ' Construct the date from the 3 parts dtmDate = CDate( objLookup("month").strData_ & "/" & objLookup("day").strData_ & "/" & objLookup("year").strData_ ) ' Determine which row of the Session array contains the relavent entry intID = objLookup("id").strData_ intNumRows = UBound(arrayITN,2) ' Count the number of rows For i = 0 To intNumRows If CInt(intID) = CInt( arrayITN(ITN_ID_INDEX,i) ) Then intRowWithID = i Exit For End If Next ' Check to see if anything has actually been changed. If it has, we have to try and connect to the ' database. Otherwise, we don't have to do anything. That's easy. If arrayITN(ITN_TITLE_INDEX, intRowWithID) <> Trim( objLookup("title").strData_ ) _ Or arrayITN(ITN_SUBTITLE_INDEX, intRowWithID) <> Trim( objLookup("subtitle").strData_ ) _ Or arrayITN(ITN_STORY_INDEX, intRowWithID) <> Trim( objLookup("story").strData_ ) _ Or CDate( arrayITN(ITN_DATE_INDEX, intRowWithID) ) <> dtmDate _ Or blnPhotoChanged _ Or objLookup("photo_usage_changed").strData_ = "YES" Then ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "modifyITNInfo", Err.number, Err.Description Exit Function End If ' With that successful, construct the SQL statement and retrieve the desired row into the recordset strSQL = SQL_ITN_INFO & objLookup("id").strData_ ' And try to retrieve the proper recordset data objRecordset.Open strSQL, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdText ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "modifyITNInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Make sure we have actual returned a row If objRecordset.EOF Then Exit Function ' Update the name and bio fields objRecordset(db_ITN_sTitle) = Trim( objLookup("title").strData_ ) objRecordset(db_ITN_sSubtitle) = Trim( objLookup("subtitle").strData_ ) objRecordset(db_ITN_sStory) = Trim( objLookup("story").strData_ ) objRecordset(db_ITN_sDate) = dtmDate objRecordset("ModifiedBy") = strUser objRecordset("ModifiedDate") = Now() ' We only have to update each image field if the images were updated If blnPhotoChanged Then ' We have to then check to see if the user really wants the image If objLookup("photo_use").strData_ = "YES" Then ' First create the filename for the new file strPhotoFilename = ITN_PHOTO_NAME & objRecordset(db_ITN_id) & "." & getFilenameExtension( objLookup("photo").strFilename_ ) ' Then decide if we need to delete the old file, that is do the old and new files have different names? ' If they do, the new one will simply overwrite the old one. Otherwise we have to specifically delete the old one strOldPhotoFilename = objRecordset(db_ITN_sPhoto) If Trim( strPhotoFilename ) <> Trim ( strOldPhotoFilename ) And Trim( strOldPhotoFilename ) <> NO_PHOTO Then queueForDelete( strImgDirectory & strOldPhotoFilename ) End If ' First update the field in the database objRecordset(db_ITN_sPhoto) = strPhotoFilename ' Make sure this photo is not going to get deleted removeFromDeleteQueue( strImgDirectory & strPhotoFilename ) ' Then try to write the file. If the write fails we have to exit the function unsuccessfully. If Not writeFile( strImgDirectory, strPhotoFilename, objLookup("photo").strData_ ) Then Exit Function End If End If ' Then write to the database if the image is not to be used If objLookup("photo_use").strData_ = "NO" And Trim( objRecordset(db_ITN_sPhoto) ) <> NO_PHOTO Then ' First delete the old image file queueForDelete( strImgDirectory & objRecordset(db_ITN_sPhoto) ) ' Then set the field objRecordset(db_ITN_sPhoto) = NO_PHOTO End If ' Finally update the database objRecordset.Update End If ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "modifyITNInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. modifyITNInfo = True End Function Function getBranchInfo() 'On Error Resume Next Dim oADO, oRecordset, strSQL, bool_ADO, bool_REC, arrayBranch bool_ADO = getADO(oAdo) ' get connection object bool_REC = getRecordset(oRecordset) ' get connection objec getBranchInfo = false if ((bool_ADO = true) and (bool_REC = true)) then ' test to see if we can use the connection objects strSQL = sqlBranch oADO.Open db_strConn ' open connection to db oRecordset.Open strSQL, oADO ' open recordset using SQL statement ' If the recordset has at least one row, no problem If Not oRecordSet.EOF Then arrayBranch = oRecordSet.GetRows Session("branch") = arrayBranch ' Otherwise the array is the empty set Else Session("branch") = Null End If end if If Err Then getBranchInfo = False SetError "getBranchInfo", Err.number, Err.description Session(cChangeInfoError) = "getBranch" & Err.number & " " & Err.Description & " " Exit Function End If ' If we get here, we're true getBranchInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: addBranchInfo ' Params: None ' Returns: True if the branch is succesfully added. False if not. ' Effects: Inserts the inputted branch into the Branches table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function addBranchInfo() ' Take care of errors 'On Error Resume Next addBranchInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "addBranchInfo", Err.number, Err.Description Exit Function End If ' Try to retrieve the proper recordset data objRecordset.CursorLocation = adUseClient objRecordset.Open db_BRANCH, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdTable ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "addBranchInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Add a row objRecordset.AddNew ' Then set the fields objRecordset(db_BRANCH_Name) = Trim( objLookup("BName").strData_ ) objRecordset(db_BRANCH_Phone) = Trim( objLookup("BPhone").strData_ ) objRecordset(db_BRANCH_Abbrev) = Trim( objLookup("BAbbrev").strData_ ) objRecordset.Update ' Finally update the database objRecordset.Update ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "addBranchInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. addBranchInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: modifyBranchInfo ' Params: None ' Returns: True if the branch is succesfully updated. False if not. ' Effects: Modifies the appropriate branch in the Branches table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function modifyBranchInfo() ' Take care of errors 'On Error Resume Next modifyBranchInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup Dim intNumRows, i, intRowWithID, intID Dim arrayBranch arrayBranch = Session("branch") ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Determine which row of the Session array contains the relavent entry intID = objLookup("id").strData_ intNumRows = UBound(arrayBranch,2) ' Count the number of rows For i = 0 To intNumRows If CInt(intID) = CInt( arrayBranch(BRANCH_ID_INDEX,i) ) Then intRowWithID = i Exit For End If Next ' Check to see if anything has actually been changed. If it has, we have to try and connect to the ' database. Otherwise, we don't have to do anything. That's easy. If arrayBranch(BRANCH_NAME_INDEX, intRowWithID) <> Trim( objLookup("BName").strData_ ) _ Or arrayBranch(BRANCH_PHONE_INDEX, intRowWithID) <> Trim( objLookup("BPhone").strData_ ) _ Or arrayBranch(BRANCH_ABBREV_INDEX, intRowWithID) <> Trim( objLookup("BAbbrev").strData_ ) _ Then ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "modifyBranchInfo", Err.number, Err.Description Exit Function End If ' With that successful, construct the SQL statement and retrieve the desired row into the recordset strSQL = SQL_BRANCH_INFO & objLookup("id").strData_ ' And try to retrieve the proper recordset data objRecordset.Open strSQL, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdText ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "modifyBranchInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Make sure we have actual returned a row If objRecordset.EOF Then Exit Function ' Update the branch fields objRecordset(db_BRANCH_Name) = Trim( objLookup("BName").strData_ ) objRecordset(db_BRANCH_Phone) = Trim( objLookup("BPhone").strData_ ) objRecordset(db_BRANCH_Abbrev) = Trim( objLookup("BAbbrev").strData_ ) ' Finally update the database objRecordset.Update End If ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "modifyBranchInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. modifyBranchInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: deleteBranchInfo ' Params: None ' Expects: Request.Form collection to contain an "id" entry. This is the id to be deleted ' Returns: True if the delete was successful. False if not. ' Effects: Deletes the branch with the specified id from the Branches table and also the Matrix Table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function deleteBranchInfo() ' Take care of error handling 'On Error Resume Next deleteBranchInfo = False ' Dim the variables we'll need. Dim strBranchConstraint, strMatrixConstraint, intID ' Check to make sure an ID was passed If Request.Form("id") = "" Then Exit Function intID = Request.Form("id") ' Construct the constraint strBranchConstraint = db_BRANCH_id & " = '" & intID & "'" strMatrixConstraint = db_MATRIX_branchid & " = '" & intID & "'" ' Then try to delete the proper row from the branches table. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_BRANCH, strBranchConstraint ) Then Exit Function 'Then try to delete the proper rows from the matrix table. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_MATRIX, strMatrixConstraint ) Then Exit Function ' If all this worked, assume success. deleteBranchInfo = True End Function Function getActivityInfo() 'On Error Resume Next Dim oADO, oRecordset, oRecordset1, strSQL, strSQL1, bool_ADO, bool_REC, bool_REC1, arrayActivity, arrayProgram bool_ADO = getADO(oAdo) ' get connection object bool_REC = getRecordset(oRecordset) ' get connection objec bool_REC1 = getRecordset(oRecordset1) getActivityInfo = false if ((bool_ADO = true) and (bool_REC = true) and (bool_REC1 = true)) then ' test to see if we can use the connection objects strSQL = sqlActivity strSQL1 = sqlActProgram oADO.Open db_strConn ' open connection to db oRecordset.Open strSQL, oADO ' open recordset using SQL statement oRecordset1.Open strSQL1, oADO ' If the recordset has at least one row, no problem If Not oRecordSet.EOF Then arrayActivity = oRecordSet.GetRows Session("activity") = arrayActivity ' Otherwise the array is the empty set Else Session("activity") = Null End If If Not oRecordSet1.EOF Then arrayProgram = oRecordSet1.GetRows Session("program") = arrayProgram ' Otherwise the array is the empty set Else Session("program") = Null End If end if If Err Then getActivityInfo = False SetError "getActivityInfo", Err.number, Err.description Session(cChangeInfoError) = "getActivity" & Err.number & " " & Err.Description & " " Exit Function End If ' If we get here, we're true getActivityInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: addActivityInfo ' Params: None ' Returns: True if the activity is succesfully added. False if not. ' Effects: Inserts the inputted activity into the activity table. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function addActivityInfo() ' Take care of errors 'On Error Resume Next addActivityInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "addActivityInfo", Err.number, Err.Description Exit Function End If ' Try to retrieve the proper recordset data objRecordset.CursorLocation = adUseClient objRecordset.Open db_ACTIVITY, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdTable ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "addActivityInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Add a row objRecordset.AddNew ' Then set the fields objRecordset(db_ACTIVITY_Name) = Trim( objLookup("AName").strData_ ) objRecordset(db_ACTIVITY_ProgramID) = Trim( objLookup("AProgramId").strData_ ) objRecordset.Update ' Finally update the database objRecordset.Update ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "addActivityInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. addActivityInfo = True End Function Function modifyActivityInfo() ' Take care of errors 'On Error Resume Next modifyActivityInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup Dim intNumRows, i, intRowWithID, intID Dim arrayActivity arrayActivity = Session("activity") ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Determine which row of the Session array contains the relavent entry intID = objLookup("id").strData_ intNumRows = UBound(arrayActivity,2) ' Count the number of rows For i = 0 To intNumRows If CInt(intID) = CInt( arrayActivity(ACTIVITY_ID_INDEX,i) ) Then intRowWithID = i Exit For End If Next ' Check to see if anything has actually been changed. If it has, we have to try and connect to the ' database. Otherwise, we don't have to do anything. That's easy. If arrayActivity(ACTIVITY_NAME_INDEX, intRowWithID) <> Trim( objLookup("AName").strData_ ) _ Or arrayActivity(ACTIVITY_PROGRAMID_INDEX, intRowWithID) <> Trim( objLookup("AProgramId").strData_ ) Then ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "modifyActivityInfo", Err.number, Err.Description Exit Function End If ' With that successful, construct the SQL statement and retrieve the desired row into the recordset strSQL = SQL_ACTIVITY_INFO & objLookup("id").strData_ ' And try to retrieve the proper recordset data objRecordset.Open strSQL, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdText ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "modifyActivityInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Make sure we have actual returned a row If objRecordset.EOF Then Exit Function ' Update the branch fields objRecordset(db_ACTIVITY_Name) = Trim( objLookup("AName").strData_ ) objRecordset(db_ACTIVITY_ProgramID) = Trim( objLookup("AProgramId").strData_ ) ' Finally update the database objRecordset.Update End If ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "modifyActivityInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. modifyActivityInfo = True End Function Function deleteActivityInfo() ' Take care of error handling 'On Error Resume Next deleteActivityInfo = False ' Dim the variables we'll need. Dim strConstraint, intID ' Check to make sure an ID was passed If Request.Form("id") = "" Then Exit Function intID = Request.Form("id") ' Construct the constraint strConstraint = db_ACTIVITY_id & " = '" & intID & "'" ' Then try to delete the proper row from the activity table. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_ACTIVITY, strConstraint ) Then Exit Function ' If all this worked, assume success. deleteActivityInfo = True End Function Function getProgramInfo() 'On Error Resume Next Dim oADO, oRecordset, strSQL, bool_ADO, bool_REC, arrayProgram bool_ADO = getADO(oAdo) ' get connection object bool_REC = getRecordset(oRecordset) ' get connection objec getProgramInfo = false if ((bool_ADO = true) and (bool_REC = true)) then ' test to see if we can use the connection objects strSQL = sqlActProgram oADO.Open db_strConn ' open connection to db oRecordset.Open strSQL, oADO ' open recordset using SQL statement ' If the recordset has at least one row, no problem If Not oRecordSet.EOF Then arrayProgram = oRecordSet.GetRows Session("program") = arrayProgram ' Otherwise the array is the empty set Else Session("program") = Null End If end if If Err Then getProgramInfo = False SetError "getProgramInfo", Err.number, Err.description Session(cChangeInfoError) = "getProgram" & Err.number & " " & Err.Description & " " Exit Function End If ' If we get here, we're true getProgramInfo = True End Function Function addProgramInfo() ' Take care of errors 'On Error Resume Next addProgramInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "addProgramInfo", Err.number, Err.Description Exit Function End If ' Try to retrieve the proper recordset data objRecordset.CursorLocation = adUseClient objRecordset.Open db_PROGRAM, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdTable ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "addProgramInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Add a row objRecordset.AddNew ' Then set the fields objRecordset(db_PROGRAM_Name) = Trim( objLookup("PName").strData_ ) objRecordset.Update ' Finally update the database objRecordset.Update ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "addProgramInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. addProgramInfo = True End Function Function modifyProgramInfo() ' Take care of errors 'On Error Resume Next modifyProgramInfo = False ' Declare some variables to use Dim objDBConnection, objRecordset, strSQL, objLookup Dim intNumRows, i, intRowWithID, intID Dim arrayProgram arrayProgram = Session("program") ' Parse the http header. This is expected to be from a form of enctype multipart form/data ' If this doesn't succeed, we have no choice but to exit the write function If Not parseHeader( objLookup ) Then Exit Function ' Determine which row of the Session array contains the relavent entry intID = objLookup("id").strData_ intNumRows = UBound(arrayProgram,2) ' Count the number of rows For i = 0 To intNumRows If CInt(intID) = CInt( arrayProgram(PROGRAM_ID_INDEX,i) ) Then intRowWithID = i Exit For End If Next ' Check to see if anything has actually been changed. If it has, we have to try and connect to the ' database. Otherwise, we don't have to do anything. That's easy. If arrayProgram(PROGRAM_NAME_INDEX, intRowWithID) <> Trim( objLookup("PName").strData_ ) Then ' Create the ADO and Recordset objects... if either screws up, exit the function If Not ( GetADO( objDBConnection ) And GetRecordSet( objRecordset ) ) Then Exit Function ' Then try to connect to the database objDBConnection.Open db_strConn ' Check for errors on with this connection attempt If Err.Number Then If Not HaveError() Then SetError "modifyProgramInfo", Err.number, Err.Description Exit Function End If ' With that successful, construct the SQL statement and retrieve the desired row into the recordset strSQL = SQL_PROGRAM_INFO & objLookup("id").strData_ ' And try to retrieve the proper recordset data objRecordset.Open strSQL, objDBConnection, adOpenDynamic, adLockOptimistic, adCmdText ' Again check for errors after attempting to interact with the database If Err.Number Then If Not HaveError() Then SetError "modifyProgramInfo", Err.number, Err.Description objDBConnection.Close ' Close the (presumably) open database connection Exit Function End If ' Make sure we have actual returned a row If objRecordset.EOF Then Exit Function ' Update the branch fields objRecordset(db_PROGRAM_Name) = Trim( objLookup("PName").strData_ ) ' Finally update the database objRecordset.Update End If ' Close our connections objRecordset.Close objDBConnection.Close ' Destroy everything we new'd Set objRecordset = Nothing Set objDBConnection = Nothing Set objLookup = Nothing ' Check for errors once more If Err.Number Then If Not HaveError() Then SetError "modifyProgramInfo", Err.number, Err.Description Exit Function End If ' And finally return true if all that succeeded. modifyProgramInfo = True End Function Function deleteProgramInfo() ' Take care of error handling 'On Error Resume Next deleteProgramInfo = False ' Dim the variables we'll need. Dim strProgramConstraint, strActivityConstraint, intID ' Check to make sure an ID was passed If Request.Form("id") = "" Then Exit Function intID = Request.Form("id") ' Construct the constraint strActivityConstraint = db_ACTIVITY_Programid & " = '" & intID & "'" strProgramConstraint = db_PROGRAM_id & " = '" & intID & "'" ' Then try to delete the proper row from the branches table. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_PROGRAM, strProgramConstraint ) Then Exit Function 'Then try to delete the proper rows from the matrix table. If the delete is unsuccessful, exit the function returning false. If Not deleteRows( db_strConn, db_ACTIVITY, strActivityConstraint ) Then Exit Function ' If all this worked, assume success. deleteProgramInfo = True End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: queueForDelete ' Params: A filename to delete. This should be the full path name including the file. ' Returns: None ' Effects: Adds the file to the array of files to be deleted when the current session ends. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub queueForDelete( strFilename ) ' First set a variable to use Dim i, strDeletionArray, intNumFiles, strNewArray(), strExpandedArray(), blnFileAlreadyInQueue ' Check to see if we have to new the array If IsEmpty( Session(DELETION_QUEUE) ) Then ReDim strNewArray(DELETION_QUEUE_MAX_SIZE) Session(DELETION_QUEUE) = strNewArray Session(DELETION_QUEUE_SIZE) = 0 End If ' Set our array of items to be deleted and the num items strDeletionArray = Session(DELETION_QUEUE) intNumFiles = Session(DELETION_QUEUE_SIZE) ' Set other variables blnFileAlreadyInQueue = False ' Then check to see if the file needs to be inserted For i = 0 To intNumFiles - 1 If Trim( strDeletionArray(i) ) = Trim( strFilename ) Then blnFileAlreadyInQueue = True Exit For End If Next ' If the file is not already there then insert If Not blnFileAlreadyInQueue Then ' Check to see if the array has to be expanded If intNumFiles > UBound(strDeletionArray) Then ReDim strExpandedArray( intNumFiles * 2 ) For i = 0 To UBound(strDeletionArray) strExpandedArray(i) = strDeletionArray(i) Next strDeletionArray = strExpandedArray End If intNumFiles = intNumFiles + 1 strDeletionArray(intNumFiles - 1) = Trim( strFilename ) ' Then set the session variables to their new values Session(DELETION_QUEUE) = strDeletionArray Session(DELETION_QUEUE_SIZE) = intNumFiles End If End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: deleteQueuedFiles ' Params: None ' Returns: True if successful. False if not. ' Effects: Attempts to delete files that have been placed in the deletion queue ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function deleteQueuedFiles() ' First decide if any files need to be deleted. Does the deletion queue exist? If Not IsEmpty( Session(DELETION_QUEUE) ) Then ' First create an array that is exactly the right size ReDim strFilesArray(Session(DELETION_QUEUE_SIZE) - 1) ' Then populate the array Dim i For i = 0 To Session(DELETION_QUEUE_SIZE) - 1 strFilesArray(i) = Session(DELETION_QUEUE)(i) Next deleteQueuedFiles = deleteFile( strFilesArray ) Else deleteQueuedFiles = True End If End Function '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function: removeFromDeleteQueue ' Params: A filename to remove from the deletion queue ' Returns: None ' Effects: If the filename is in the deletion queue, remove it. Otherwise do nothing. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub removeFromDeleteQueue( strFilename ) ' Initially just check to make sure that the deletion queue has even been created If Not IsEmpty( Session(DELETION_QUEUE) ) Then ' Set up some variables to use Dim blnIsMember, strResizedFileArray(), intIndex, intNewArrayIndex ' First we have to decide if the file is in the queue already blnIsMember = False For intIndex = 0 To Session(DELETION_QUEUE_SIZE) - 1 If Trim( Session(DELETION_QUEUE)(intIndex) ) = Trim( strFilename ) Then blnIsMember = True Next ' If it is in the queue, we make an array with one fewer indices and then populate it If blnIsMember Then intNewArrayIndex = 0 ReDim strResizedFileArray(Session(DELETION_QUEUE_SIZE) - 2) For intIndex = 0 To Session(DELETION_QUEUE_SIZE) - 1 If Trim( Session(DELETION_QUEUE)(intIndex) ) <> Trim( strFilename ) Then strResizedFileArray(intNewArrayIndex) = Trim( strFilename ) intNewArrayIndex = intNewArrayIndex + 1 End If Next Session(DELETION_QUEUE_SIZE) = Session(DELETION_QUEUE_SIZE) - 1 Session(DELETION_QUEUE) = strResizedFileArray End If End If End Sub Function getBranchPage() Dim strFullPath, strFileNameOnly, id strFullPath = Request.ServerVariables("PATH_INFO") strFileNameOnly = Mid(strFullPath, InstrRev(strFullPath, "/")+1, Len(strFullPath)) id = Request.QueryString("id") if strFileNameOnly = "albany.asp" or id = 1 then getBranchPage = 1 elseif strFileNameOnly = "empire_st_plaza.asp" or id = 5 then getBranchPage = 5 elseif strFileNameOnly = "guilderland.asp" or id = 9 then getBranchPage = 9 elseif strFileNameOnly = "schenectady.asp" or id = 4 then getBranchPage = 4 elseif strFileNameOnly = "troy.asp" or id = 8 then getBranchPage = 8 elseif strFileNameOnly = "parkside.asp" or id = 3 then getBranchPage = 3 elseif strFileNameOnly = "southern_saratoga.asp" or id = 7 then getBranchPage = 7 elseif strFileNameOnly = "chingachgook.asp" or id = 2 then getBranchPage = 2 elseif strFileNameOnly = "east_greenbush.asp" or id = 16 then getBranchPage = 16 elseif strFileNameOnly = "bethlehem.asp" or id = 2 then getBranchPage = 17 else getBranchPage = 0 end if End Function %>





Pine Bush Triathlon Home
Registration & Schedule
About the Race
Travel Directions
The Dream Team to Beat
Sponsors & Hosts
Volunteers
Race Results
Photo Gallery
Contact Us

 

About the Race

Course Description

Pine-Bush-gif.gif (4743 bytes)About the Pine Bush Preserve - The Albany Pine Bush represents one of the best remaining examples of an inland pine barrens ecosystem left in the world.  This gently rolling sand plain is home to a variety of rare plants and animals, including the endangered Karner Blue butterfly.  Visitors are provided with an assortment of non motorized recreational opportunities including hiking, jogging, nature study, cross-country skiing, horseback riding, mountain biking and hunting.  There are over 20 miles of marked multiple use trails, some of which are paved.  Efforts by the Albany Pine Bush Preserve Commission have protected over 2750 acres of this beautiful ecosystem.  Learn more about the Pine Bush by visiting the Commission’s web site at www.albanypinebush.org.

The Swim — The event starts with a 325-yard swim at the City of Albany’s Six Mile Waterworks also known as Rensselaer Lake, which is part of the Pine Bush Preserve.  The Pine Bush Preserve is a rare inland pine barren ecosystem.  The Lake previously was the Albany Reservoir and now is a reserve system for the City of Albany's Water Department.  Swimming is allowed in the Lake under a special permit.  The swim will be conducted with "heats" of approximately 50 people each.  The course is an L-shaped route, which starts at the gazebo.   It travels north to a 90 degree left turn at a buoy.  Then the swimmers go the length of the lake past the west side of the pump house to the water’s edge.
A separate water exit is available for wheelchair athletes.  This is a step riser and platform. The system was designed with the assistance of our special friend and wheelchair athlete, April Coughlin.

Pine Bush Triathlon 325 Yard Swim Route

 

The Swim/Bike Transition Area - Swimmers exit the water onto a 40-ft. long, sandy incline that leads to the paved path.  The pathway is 12 ft. wide and 400 ft. long to the bike mounting sign.  Bike team members will be lined up on the pavement on the right side of the pathway.  A hand slap and passing of the timing chip completes the team member exchange. Individual participant’s bikes are racked on the left side of the transition area on the grass and paved surface.

Swim Transition.jpg (50401 bytes)

The Bike -- The biking leg of the triathlon is 11.5 miles. It begins at the southern end of the lake and follows the paved path west.  It turns south on Rapp Road going over the Thruway then turns west on Washington Ave. Extension.   At the end of Washington Ave. Extension it turns north on Route 155 / New Karner Road and then west onto Old State Road.  Here it re-enters parts of the scenic Pine Bush Preserve and leaves the City of Albany into the Town of Guilderland.  The course continues west on Old State Road through the intersection of Route 146 / Carmen Road.   It turns south on Fuller Station Road and then east on Route 20 / Western Ave. It follows Western Ave. east past Route 146 and turns south on Mercy Care Lane which leads into the transition area.

Pine Bush Triathlon 11.5 Mile Bike Route

 

BikeElevation.gif (5078 bytes)

The Bike/Run Transition Area - Bike riders turn onto Mercy Care Lane to the transition area.  The bike dismount sign is visible at the first bend in the road.  Team members should be waiting at the beginning of the transition area.  Team members will transfer the timing chip and a hand slap will complete the exchange. The bike member will exit the transition area with their bike.  Individual participants can rack their bikes and start the run at the other end of the transition area on Winding Brook Drive. A center lane of Winding Brook Drive will be opened for local traffic.  The run is an "out and back" staying on the right side of the road moving with the traffic direction.

Finish Transition.jpg (62489 bytes)

The Run — The last leg is the 3.25 mile run which is an out and back route with the finish line at the YMCA.  The run starts south on Winding Brook Drive to Nott Road when it turns left proceeding eastward.  It takes a left turn into a residential neighborhood at Campus Club Drive and left again onto Hiawatha Drive.  This is the halfway point of the run. Hiawatha Drive loops around and meets again with Campus Club Drive.  The course follows the same route backward to the YMCA and to the Finish Line!  Enter the race chutes and at the end of the chute remove the timing chip and strap and hand it to the race official.

Pine Bush Triathlon 3.25 Mile Run Route

RunElevation.gif (4771 bytes)

Rules

The following rules have been designed for your safety and enjoyment. Failure to comply with any of the rules can result in penalties, and /or removal from the race. Instructions at the pre-race briefing supercede any or all of the following rules.

SWIM
  • Competitors must be numbered on both arms at the YMCA not at the Lake.
  • All competitors must wear the swim cap provided in the race packet — no substitutes allowed. Wet suits are allowed (most participants do not use them).
  • If swimmers are in need of help during the event, they should attempt to wave one arm out of the water. Several YMCA lifeguards will be stationed in the water for assistance.

BIKE

  • Each competitor is responsible for the care and maintenance of their bike.
  • The bike frame number must be attached to the front of the top tube and must be clearly visible at all times.
  • The bike helmet number must be attached to the front center of the helmet.
  • A bike helmet is mandatory during the entire bike race. Helmets must meet current safety standards. Helmets must be securely strapped prior to mounting the bike and can not be unstrapped until after dismount.
  • Bikes can not be mounted until after leaving the Swim/Bike transition area.
  • Drafting another competitor is not recommended. For your safety, a minimum of one bike length should be maintained between you and the competitor in front of you. If you are passed by another competitor you should slip back to a safe distance.
  • Competitors must follow instructions of race officials and public authorities and must obey all traffic laws.
  • Competitors must ride to the right on the road at all times.
  • Bikes must be dismounted prior to entering the Bike/Run transition area.

RUN

  • Competitors must wear their run number on their front where it is clearly visible at all times. Do not pin the "tear tag".
  • Run on the right shoulder of the road.
  • Stay in line in the race finish chute until your race number "tear tag" has been taken by the race official.

GENERAL

  • It is the competitor’s responsibility to be familiar with and follow the race route.
  • Entry into the transition areas is allowed only to competitors.
  • Competitors must follow the directions of race officials and public authorities.
  • Race officials have the ultimate and final authority to remove competitors who violate race rules or who display irresponsible behavior.
  • Friends, family, assistants or pets may not accompany race competitors and should be warned to stay clear of all competitors.
  • Competitors are not allowed to wear headphones, earplugs or any other sound device that impairs normal hearing.
  • Good sportsperson-like conduct is required of all competitors.
  • To receive an award, you must be present at the awards ceremony.
  • Participants are responsible for the care of the timing chip.  Lost or damaged chips are the responsibility of the athlete and will be charged a fee for its replacement.
  • In the event of inclement weather, race officials may cancel all or a portion of the race.  There are no "rain dates" or refunds due to cancellation.

Awards

All participants will receive a Pine Bush Triathlon T-shirt  Here’s the list of our awards!

Individual Participants

  • Open Age Group – 1st, 2nd and 3rd Place awards will be given to the overall male and female finishers and in the following age groups; 10-14, 15-19, 20-24, 25-29, 30-34, 35-39, 40-44, 45-49, 50-54, 55-59, 60-64, 65-69, and 70+.
  • Wheelchair Division - 1st, 2nd and 3rd Place awards will be given to the overall male and female finishers
  • City & Suburb Award – The resident of the city of Albany or the town of Guilderland with the fastest overall time. A special award will also be presented to the winner's municipality with the winner's name engraved.
  • Lt. John Finn Public Safety Award - 1st, 2nd and 3rd Place awards will be given to the overall finishers who are Police, Fire or EMS Department Employees

Team Participants


Team Participants (teams of three only)

  • Dream Team Award1st, 2nd and 3rd Place team finishers
  • Scrub Oak Award – Team to finish with the highest cumulative age
  • Acorn Award – Team to finish with the lowest cumulative age
  • High School Award – 9th to 12th grade students
  • Middle School Award – 5th to 8th grade students
  • Family Award I– One parent and two children age18 or under
  • Family Award II– Two parents and one child age18 or under
  • Sibling Award – Team of brothers and/or sisters age18 or under
  • Police Department Award – Police Department Teams competition
  • Fire Department Award– Fire Department Teams competition