在function中使用recordset对象

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) %>

posted on 2004-10-10 18:43  一望无际的南  阅读(575)  评论(0编辑  收藏  举报

导航