部分程序如下,以前一直运行都正常:
<% if session("login")="" then Response.Redirect("login.asp") %>
<!-- #include file="../include/connection.inc" -->
<%
dim vYear,vMonth,vName,vBuilding ,vCell,vHouse, selYear,selMonth,txtName,selBuilding,selCell,txtHouse ,vPayCode
selYear=trim(Request.Form("selYear"))
if selYear="" then selYear=request("selYear")
if selYear="" then selYear=year(date())
vYear=" and WE_Year= '"& selYear &"'"
selMonth=trim(Request.Form("selMonth"))
if selMonth="" then selMonth=request("selMonth")
if selMonth="" then
vMonth=""
else
vMonth=" and WE_Month= '"& selMonth &"'"
end if
txtName=trim(Request.Form("txtName"))
'if txtName="" then txtName=request("txtName")
if txtName="" then
vName=""
else
vName=" and WE_Name like '"& txtName &"%'"
end if
selBuilding=trim(Request.Form("selBuilding"))
if selBuilding="" then selBuilding=request("selBuilding")
if selBuilding="所有" or selBuilding="" then
vBuilding=""
else
vBuilding=" and WE_buildingID= '"& selBuilding &"'"
end if
selCell=trim(Request.Form("selCell"))
'if selCell="" then selCell=request("selCell")
if selCell="所有" or selCell="" then
vCell=""
else
vCell=" and WE_cell= '"& selCell &"'"
end if
txtHouse=trim(Request.Form("txtHouse"))
'if txtHouse="" then txtHouse=request("txtHouse")
if txtHouse="" then
vHouse=""
else
vHouse=" and WE_House like '"& txtHouse &"%'"
end if
txtPayCode=trim(Request.Form("txtPayCode"))
'if txtPayCode="" then txtPayCode=request("txtPayCode")
if txtPayCode="0" then
vPayCode=" and WE_PayCode=''"
else
vPayCode=" and WE_PayCode like '"& txtPayCode &"%'"
end if
%>
<%
dim strSQL
dim rs,i
i=0
strSQL="select we_id,WE_PayCode,WE_name,WE_buildingID,WE_house,we_year,we_month,we_e_preNum,we_e_nowNum,we_e_nowNum-we_e_preNum as we_e_degree,WE_e_unitprice,(we_e_nowNum-we_e_preNum)*we_e_unitprice as we_e_money," &_
" WE_w_preNum,WE_w_nowNum,WE_w_nowNum-WE_w_preNum as we_w_degree,WE_w_unitprice,(WE_w_nowNum-WE_w_preNum)*we_w_unitprice as we_w_money,(we_e_nowNum-we_e_preNum)*we_e_unitprice+(WE_w_nowNum-WE_w_preNum)*we_w_unitprice as we_sum,"&_
"WE_deptID,WE_remark from T_Logistics_water_eletricity where WE_userType='1'" & vYear & vMonth & vName & vBuilding & vCell & vHouse & vPayCode & " order by WE_Year,WE_Month,WE_buildingID,WE_house"
set rs=cn.execute(strSQL)
while not rs.EOF
i=i+1
%>