目录树

<% '获得大类 dim first dim i i=0 set rs=server.CreateObject("adodb.recordset") sql="select * from catalogs where parentid=0 order by id asc" rs.open sql,conn,3,1 first=rs.GetRows() rs.close set rs=nothing response.Write("bigclass-----------------------"&ubound(List,2)&"----------------
") '获得所有par_id=<>的类别------主类：par_id=0 if(ubound(first,2)<0) then response.Write("暂时没有分类") else 'CheckList 0,2,"" end if Function getcatalogs(parentid) Dim Sql,rstemp,TemptempStr,tempStr tempStr=" "&tempStr sql="select * from catalogs where parentid="&parentid Set rstemp = Conn.Execute(Sql) do while Not rstemp.Eof getcatalogs = tempStr&getcatalogs &rstemp("id")&":"& rstemp("title")&"
" getcatalogs = getcatalogs & getcatalogs(rstemp("id")) rstemp.MoveNext loop Set rstemp = Nothing End Function 'for i=0 to ubound(first,2) 'response.Write(first(0,i)&"-----------------------"&first(2,i)&"
") response.Write(getcatalogs(0)) ' 'next %>

<%call connclose()%>