您的位置:首页 > 其它

在function中使用recordset对象

2004-10-10 18:43 495 查看
function GetTotalFee(rsObj)
set rs = rsobj

allsum = 0
rs.Movefirst

while not rs.eof
daysum =0
for i=6 to rs.fields.count-8
if instr(lcase(rs.fields(i).name),"remark")=0 then
if Not IsNull(rs(rs.fields(i).name)) then
if cint(trim(rs(rs.fields(i).name)))<>0 then
daysum=daysum+cint(trim(rs(rs.fields(i).name)))
'Response.write daysum&"<br>"

end if
end if
end if

next

allsum = allsum + cint(daysum)

rs.MoveNext

wend
GetTotalFee = allsum
end function

sql_display="select * from expense where fileno ='"&strBH&"' order by expenseDate asc"

set objDisplay=conn.execute(sql_display)
调用

<%=GetTotalFee(objDisplay) %>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: