关于ASP递归的问题讨论,高手请进!
jnqjj 2005-12-09 05:32:20 我再在用ASP写了个递归的程序,可是执行的速度太慢了,有哪位高手能给出以下程序的优化解决方法,虚心求教!敬请帮忙!!在线等待:
sub childnum(byval userid) '递归的遍历函数
dim rs
set rs=Server.CreateObject("adodb.recordset")
sql="select userid,shenhe,zcdata from user where anid="&userid
rs.open sql,conn
Do while not rs.eof
if rs("shenhe")=1 then
k=k+1 '计数器+1
end if
call childnum(rs("userid"))
rs.movenext
Loop
rs.close
set rs=nothing
end sub '函数结束