<% '============= Create and Open Database Connection ============= 'OPEN THE DATABASE If blnConnectToDB Then dim blnDBconnectionDown blnDBconnectionDown = false Err.Clear on error resume next set dbConn = Server.CreateObject("ADODB.Connection") 'Open the Connnection 'dbConn.Open Application("dbConn_ConnectionString") dbConn.Open "DSN=PostgreSQL30", "eere_news", "33reNews" ''New Error trapping. KC added 2/23/2012 If Err.Number <> 0 Then ''Response.Write (Err.Description& "

") dbConn.Close Set dbConn = nothing blnDBconnectionDown = true End If On Error GoTo 0 ''error trapping not working here KC removed 2/23/2012 ''tmpDBErrorNativeError = 0 '' For Each dbErr In dbConn.Errors '' strErrMsg = strErrMsg & _ '' "Source: " & dbErr.Source & vbCrLF & _ '' "Description: " & dbErr.Description & vbCrLF & _ '' "SQL State: " & dbErr.SQLState & vbCrLF & _ '' "NativeError: " & dbErr.NativeError & vbCrLF & _ '' "Number: " & dbErr.Number & vbCrLF & vbCrLF '' tmpDBErrorNativeError = dbErr.NativeError '' Next '' If (dbConn.Errors.Count > 0) AND (tmpDBErrorNativeError <> 5703) Then '' dbConn.Close '' Set dbConn = nothing '' blnDBconnectionDown = true '' Response.write(strErrMsg) '' Response.end '' End If dim arrErrors() Redim arrErrors(2,0) End If '============================================================== Public Function GetRS2(myCommand) On Error GoTo 0 'objConn: local connection object 'objRS: local recordset object 'objComm: command object passed in to the function Dim objConn, objRS, blnErrorLogged, objComm 'Create the command object Set objComm = Server.CreateObject("ADODB.Command") Set objComm = myCommand 'Create the connection object Set objConn = Server.CreateObject("ADODB.Connection") 'Open the connection object objConn.Open "DSN=PostgreSQL30", "eere_news", "33reNews" 'Set the active connection objComm.ActiveConnection = objConn 'Create the recordset object Set objRS = Server.CreateObject("ADODB.Recordset") 'Set the cursor location for disconnected recordsets 'objRS.CursorLocation = adUseClient 'Turn on error handling for just a second ' On Error Resume Next 'Open the recordset 'objRS.Open SQL, objConn, adOpenStatic, adLockOptimistic Set objRS = objComm.Execute 'Response.Write "State = " & objRS.State & "
" 'objRS.MoveLast 'objRS.MoveFirst 'Response.Write "Count = " & objRS.RecordCount & "
" 'Response.End 'Check for an error ' If Err.Number <> 0 Then ' Response.Write "Database Error Occured

" ' Response.Write "Error #" & Err.Number & "
" ' Response.Write Err.Description & "

" ' Response.Write "SQL:
" ' Response.Write SQL ' Response.End ' End If 'Turn off error handling ' On Error GoTo 0 'Disconnect the recordset 'Set objComm.ActiveConnection = Nothing 'Close the connection 'objConn.Close 'Set the connection to Nothing 'Set objConn = Nothing 'Set the Command to Nothing 'Set objComm = Nothing 'Return the recordset Set GetRS2 = objRS On Error Resume Next End Function '=============================================================== Function GetRS(sSQL) 'Declarations dim rs 'Create Recordset Object set rs = Server.CreateObject("ADODB.Recordset") If blnConnectToDB Then 'Open Recordset based on SQL rs.Open sSQL, dbConn, 1, 3, 1 End If 'Return Recordset set GetRs = rs End Function '=============================================================== Function ExecSQL(sSQL) 'Open the Command Object dim lRecordsAffected dbConn.Execute sSQL, lRecordsAffected 'Return the Records Affected ExecSQL = lRecordsAffected End Function '======================================================================== Function sendEmail(strFrom,strTo,strSubject,strMessage) Dim sch ' Schema sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(sch & "sendusing") = 2 .Item(sch & "smtpserver") = "mxrelay.doe.gov" .update End With Set cdoMessage = CreateObject("CDO.Message") With cdoMessage Set .Configuration = cdoConfig .From = strFrom .To = strTo .Subject = strSubject .TextBody = strMessage .Send End With Set cdoMessage = Nothing Set cdoConfig = Nothing End Function Function removeBadChars(tmpString) tmpString = Replace(tmpString , "<", "") tmpString = Replace(tmpString , ">", "") tmpString = Replace(tmpString , "'", "") tmpString = Replace(tmpString , """", "") tmpString = Replace(tmpString , ";", "") tmpString = Replace(tmpString , "(", "") tmpString = Replace(tmpString , ")", "") removeBadChars = tmpString End Function %> <% 'If there is a mobile version of this site, check the user_agent, and forward to 'the mobile version of the site (unless cookie or querystring var is set) if "true" = "true" then tmpSeeFullPage = Mid(Request.Querystring("m"),1,1) if ((isMobile) and (tmpSeeFullPage <> "1")) then tmpMobileURL = Request.servervariables("HTTP_URL") tmpMobileFileName = mid(tmpMobileURL, InStrRev(tmpMobileURL, "/")+1) tmpMobileURL = Left(tmpMobileURL, InStrRev(tmpMobileURL, "/")) tmpMobileURL = tmpMobileURL & "m/" & tmpMobileFileName Response.Clear Response.Redirect(tmpMobileURL) end if end if %>

<% ''This code is strictly when a user clicks on a left nav and needs to be forwarded to another site/program/office if ("" <> "") then Response.Clear Response.Redirect ("") end if %>

Federal Requirements for Renewable Energy

Multiple laws and executive orders define requirements for the use of renewable energy in Federal facilities.

The Energy Policy Act (EPAct) of 2005:

  • Defines "renewable energy" as electric energy generated from solar, wind, biomass, landfill gas, ocean (including tidal, wave, current, and thermal), geothermal, municipal solid waste, or new hydroelectric generation capacity achieved from increased efficiency or additions of new capacity at an existing hydroelectric project

  • Requires the Secretary of Energy to ensure that, to the extent economically feasible and technically practicable, the following amounts of the total electricity consumed by the Federal government come from renewable energy:

    • Not less than 3% in fiscal years 2007-2009
    • Not less than 5% in fiscal years 2010-2012
    • Not less than 7.5% in fiscal year 2013 and thereafter.

  • Provides a bonus to Federal agencies by allowing them to double count renewable energy if it is produced on-site and used at a Federal facility, produced on Federal lands and used at a Federal facility, or produced on Native American land and used at a Federal facility.

The Energy Independence and Security Act (EISA) of 2007:

  • Requires 30% of the hot water demand in new Federal buildings (and major renovations) be met with solar hot water equipment provided it is life-cycle cost-effective.

  • Requires new buildings and major renovations of Federal buildings to reduce fossil fuel consumption relative to 2003 by:

    • 55% by 2010
    • 65% by 2015
    • 80% by 2020
    • 100% by 2030

  • Makes it easier for Federal agencies to finance renewable energy projects with energy savings performance contracts (ESPCs) through the following:

    • Project funding flexibility is increased by allowing agencies to combine appropriated funds and private financing.

    • Contract length limitations to less than 25 years are also restricted, as are total obligation amount limitations.

    • The definition of ESPC is expanded to include the use of excess electrical or thermal energy generated from on-site renewable sources.

Executive Order (E.O.) 13423:

  • Reinforces the legislative renewable goals. Specifically, the order mandates that at least half of renewable energy used by the Federal government must come from new renewable sources (in service after January 1, 1999). Non-electric renewable resources (e.g., solar water heating) can be used to meet this requirement, but all of the EPAct 2005 goal must be met with renewable electricity.


The Renewable Energy Working Group developed guidance for Federal agencies on what can be counted toward EPAct 2005 renewable energy goals as modified by E.O. 13423. Key elements of the guidance are listed below.

  • The statute limits the definition of renewable energy to electricity, so non-electric energy from renewable resources does not count toward the goal.

  • "New" renewable energy has to come from facilities placed in service after January 1, 1999.

  • To "use" renewable energy, in compliance with wording in the law, means the agency must consume renewable energy to count it toward the goal. Simply producing renewable energy on a Federal site does not count as use.

  • Purchasing renewable energy certificates (RECs) is equivalent to purchasing and consuming renewable electricity and does count toward the goal.

  • RECs from a project must be retained by the agency to count toward the EPAct 2005 goal. If RECs are not retained by the agency, it cannot claim to be using renewable energy because the right to that claim is transferred to the owner of the RECs.

  • The EPAct 2005 bonus for renewable energy from a project on Federal or Native American land is only available if an agency retains the RECs associated with the generation from the project. However, agencies can "swap" RECs purchased from another source to replace RECs sold to finance an on-site project and still receive the bonus.

  • Buying renewable fuels like biomass from a source that is not on Federal or Native American land, but then converting the fuel to useful energy on a Federal site or Native American land allows an agency to claim the EPAct 2005 bonus. Renewable fuel converted to useful energy, such as electricity or steam, in a facility that is not located on Federal or Native American land that is then delivered to a site does not qualify for the EPAct 2005 bonus.

  • Credit for renewable energy use in calculating energy efficiency goals will be gradually phased out between 2007 and 2012.

Read Federal Renewable Energy Requirement Guidance under EPAct 2005 and E.O. 13423 and the transmittal letter summarizing the guidance.