递归求子树的函数哪里错了?高手请进
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="common/inc/conn.asp"-->
<%
public sub findtree(oid)
oid=cint(oid)
'strsql="select *,(select * from classTree where poid="&oid&") as children from classTree T where poid="&oid&" and oid <> "&oid
strsql="select Oid,Poid,Nodename (select Oid,Poid,NodeName from classTree where poid=T.oid) as children from classTree T where poid="&oid&" and oid <> "&oid
'response.write strsql
set objRSsub=server.createobject("adodb.recordset")
objRSsub.open strsql,conn,1,3
response.end
do while not objRSsub.eof
IF objRSsub("children")=0 then
response.write objRSsub("nodeName")&"<br>"
Else
findtree(objRSsub("oid"))
End IF
objRSsub.movenext
loop
End sub
DIM rs,strSQL
set rs=server.createobject("adodb.recordset")
strSQL="select *,(select count(*) from classTree where poid = oid) as children from classTree where poid=oid"
rs.open strSQL,conn,3,3
do while not rs.eof
if rs("children")>0 then
findtree(oid)
end if
rs.movenext
loop
%>