recursing query

1. Senior Member
Join Date
Dec 1969
Posts
329

## recursing query

From the scott mitchells article on recursing.. i made a tree like display of users and users under that user in a table. But i culdnt make out the count of the main user . e.g in this msg board u get a total number of replies for a qtn.. thats the number i need.<BR><BR>Heres the code <BR><BR><BR>set rs=server.createobject("adodb.recordset")<BR>rs.op en "select * from user",dbc<BR><BR>amycategories=rs.getrows<BR>rs.cl ose<BR>set rs=nothing<BR>dbc.close<BR>set dbc=nothing<BR><BR>Dim str<BR>str = DisplayCategories(aMyCategories,0, 0)<BR>Response.Write(str )<BR><BR><BR><BR>Function DisplayCategories(aCategories, ByVal iCurID, ByVal iDepth)<BR><BR><BR> Dim strHTML<BR> strHTML = ""<BR> <BR>const userid=0, username=1, userlevel=2, userunder=3<BR> <BR> Dim iNumRecords, iLoop, i<BR>numb=0<BR><BR> iNumRecords = UBound(aCategories, 2)<BR><BR> For iLoop = 0 to iNumRecords<BR> If CInt(aCategories(userunder, iLoop)) = CInt(iCurID) then<BR><BR> For i = 1 to iDepth<BR><BR> strHTML = strHTML & "&nbsp;&nbsp;&nbsp;&nbsp; " <BR><BR> Next<BR><BR> strHTML = strHTML & "&#060;a href=""" & aCategories(username, iLoop) & """&#062;" & _<BR> aCategories(userName, iLoop) & "&#060;/a&#062;&#060;br /&#062;"<BR><BR> strHTML = strHTML & _<BR> DisplayCategories(aCategories, aCategories(userid,iLoop), iDepth+1)<BR><BR> End If<BR><BR> Next<BR><BR><BR><BR>brij <BR>

2. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## This might make things..

.. worse for you.<BR><BR>But, here is a similar task - I&#039;m using recursion to get information from the File System Object about folders & files. I remember doing some counts w/ it:<BR>http://www.27seconds.com/kb/article_view.asp?id=37

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•