Posted By

krisdb on 03/08/07


Tagged

ASP


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

asifrizvigmailcom


breadCrumbs (recursive)


 / Published in: ASP
 

  1. sub getChildren(rowId)
  2. Dim sSQL,oRS,itemArray,i
  3. sSQL = "SELECT rowId,rowName,parent_id from table WHERE parent_id = " & rowId
  4. set oRS = cn.execute(sSQL)
  5. itemArray = oRS.getRows()
  6.  
  7. if isArray(itemArray) then
  8. dim rowId,rowName,parent_id
  9. for i = 0 to ubound(itemArray,2)
  10. rowId = itemArray(0,i)
  11. rowName = itemArray(1,i)
  12. parent_id = itemArray(2,i)
  13.  
  14. call getChildren(parent_id) 'pass in parent id here
  15.  
  16. response.write " >> <a href=""page.asp?p="&rowId&""">"&rowName&"</a>"
  17.  
  18. next
  19. end if
  20. end sub

Report this snippet  

You need to login to post a comment.