当前位置: 代码迷 >> ASP >> 为什么不返回值解决办法
  详细解决方案

为什么不返回值解决办法

热度:23   发布时间:2012-03-11 18:15:39.0
为什么不返回值
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
  相关解决方案