<% '============= 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 %> <% 'initialize getPageFormVars(). This function is for printable versions of .asp pages that pass form variables function getPageFormVars() getPageFormVars = "" end function %> Federal Energy Management Program: Energy Cost Calculator for Faucets and Showerheads

U.S. Department of Energy: Energy Efficiency and Renewable Energy

Federal Energy Management ProgramTechnologies

Site Navigation ↓
<% '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 %>

Energy Cost Calculator for Faucets and Showerheads


Vary utility cost, hours of operation, and /or efficiency level.

INPUT SECTION
Input the following data (if any parameter is missing, calculator will set to the default value). Defaults
Water Saving Product    Faucet Showerhead
Flow Rate    gpm 2.2 gpm 2.5 gpm
Water Cost (including waste water charges)    $/1000 gal $4/1000 gal $4/1000 gal
Gas Cost    $/therm 0.60 $/therm 0.60 $/therm
Electricity Cost    $/kWh 0.06 $/kWh 0.06 $/kWh
Minutes per Day of Operation    minutes 30 minutes 20 minutes
Days per Year of Operation    days 260 days 365 days
Quantity to be Purchased    unit(s) 1 unit 1 unit
OUTPUT SECTION
Performance per Your
Choice
Base
Model
FEMP
Recommended
Level
Best
Available
Self Closing Faucet
(gallon per cycle)
WATER USE ONLY
Gallon per Minute     gpm            
Annual Water Use     gal            
Annual Water Cost $ $ $ $ $
Lifetime Water Cost $ $ $ $ $
WITH ELECTRIC WATER HEATING
Annual Energy Use     kWh            
Annual Energy Cost $ $ $ $ $
Lifetime Energy Cost $ $ $ $ $
Lifetime Energy and Water Cost Savings $ $ $ $ $
Lifetime Energy and Water Cost Savings for $ $ $ $ $
WITH GAS WATER HEATING
Annual Energy Use     therms            
Annual Energy Cost $ $ $ $ $
Lifetime Energy Cost $ $ $ $ $
Lifetime Energy and Water Cost Savings $ $ $ $ $
Lifetime Energy and Water Cost Savings for $ $ $ $ $

For electric water heating applications, your selection of an energy saving with a flow rate of gallon(s) per minute will have a combined energy and water cost savings (per ) of $ over an estimated 10 year life expectancy compared to the base model.

For gas water heating applications, your selection of an energy saving with a flow rate of gallon(s) per minute will have a combined energy and water cost savings (per ) of $ over an estimated 10 year life expectancy compared to the base model.

Assumptions

Disclaimer
This cost calculator is a screening tool that estimates a product's lifetime energy cost savings at various efficiency levels. Maintenance and installation costs do not vary significantly among the same product having different efficiencies; so, these costs are not included in this calculator tool. For a detailed life-cycle cost analysis, FEMP has developed a tool called Building Life-Cycle Cost (BLCC). This downloadable tool allows the user to vary interest rates, installation costs, maintenance costs, salvage values, and life expectancy for a product or an entire energy project.

Back to Top | ">View Full Site
Federal Energy Management Program Home | EERE Home
Webmaster | Search
Content Last Updated: 11/03/2010