读书人

为什么不返回值解决办法

发布时间: 2012-03-11 18:15:39 作者: rapoo

为什么不返回值
function cc(str)
dim i
i=0
set rs_l=server.CreateObject( "ADODB.RecordSet ")
sql_l= "select * from t where id= "&str
rs_l.open sql_l,conn,1,1
do while not rs_l.eof
if rs_l( "a ")> rs_l( "b ") then
i=i+1
end if
rs_l.movenext
loop
cc=i
rs_l.close
end function
运行后返回值为空,不知道什么原因?

[解决办法]

错了!!!

function cc(id)
cc = conn.Execute( "select Count(*) from t where id= " & id & " and a> b ",,&h0001)(0)
end function

读书人网 >ASP

热点推荐