在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) %>
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) %>
相关文章推荐
- js中三种使用function()的方法
- Canvas使用错误:screen.getContext('2d') is not a function
- 使用c99编译出warning: implicit declaration of function ‘popen’
- 【转载】ABAP:Function 之 Read_Text函数的使用方法
- item 11: 比起private undefined function优先使用deleted function
- vuejs路由使用的问题Error in render function: "TypeError: Cannot read property 'matched' of undefined"
- 使用register_shutdown_function实现php项目脚本执行失败的实时报警
- 怎样使用为存储过程procedure和函数function的参数指定的默认值
- Embeded Matlab Function使用介绍
- C++中friend的使用(friend function and friend class)
- PHP register_shutdown_function()函数的使用示例
- function作为parameter来使用
- js函数使用技巧之 setTimeout(function(){},0)
- 管道函数(pipelined function)简单使用示例
- c++11 function使用
- xcode6 使用MJRefresh,Too many arguments to function call, expected 0, have *
- 宏的高级使用--##,__VA_ARGS__, __FILE__, __FUNCTION__等
- [zz]C++中std::tr1::function和bind 组件的使用
- [boost]使用boost::function和boost::bind产生的down机一例
- java8 lambda 使用 与 functional interface 与 function 类