Tempo fa usai una routine del genere che avevo trovato sul web e modificata a mio uso, per visualizzare una distinta componenti ad albero sul nostro sito intrante.
Vedi se ti può essere utile.
Saluti
<%@ Language=VBScript %>
<!-- #include file="tree.asp" -->
<%
'========================================
' BUILDING A TREE PROGRAMATICALLY
'========================================
' This approach would be best suited for building
' dynamic trees using For..Next loops and such.
Set MyTree2 = New Tree
MyTree2.Top = 10
MyTree2.Left = 10
MyTree2.ExpandImage = "plus.gif"
MyTree2.CollapseImage = "minus.gif"
MyTree2.LeafImage = "blank.gif"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim addrpc
addrpc = Request.Cookies("Adr")
Dim DbPath, Conn
DbPath="database.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & addrpc
Dim strSQL, Rs
strSQL = "SELECT * FROM Albero"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open strSQL, Conn, 3, 3
if Rs.EOF then
Response.write "Nessun risultato trovato!"
else
Do while NOT Rs.EOF
Pos0 = Rs("P0")
Pos1 = Rs("P1")
Pos2 = Rs("P2")
Pos3 = Rs("P3")
Pos4 = Rs("P4")
Pos5 = Rs("P5")
Pos6 = Rs("P6")
Pos7 = Rs("P7")
Pos8 = Rs("P8")
Pos9 = Rs("P9")
Pos10 = Rs("P10")
Codice = Rs("Figlio")
Descr = Rs("Descrizione")
Ubi = Rs("Ubicazione")
Addr = Rs("Url")
If IsNull(Pos1) Then
Set Node1 = MyTree2.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos2) Then
Set SubNode1 = Node1.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos3) Then
Set SubNode2 = SubNode1.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos4) Then
Set SubNode3 = SubNode2.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos5) Then
Set SubNode4 = SubNode3.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos6) Then
Set SubNode5 = SubNode4.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos7) Then
Set SubNode6 = SubNode5.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos8) Then
Set SubNode7 = SubNode6.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos9) Then
Set SubNode8 = SubNode7.CreateChild(Codice,Descr,Ubi,Addr)
Else
If IsNull(Pos10) Then
Set SubNode9 = SubNode8.CreateChild(Codice,Descr,Ubi,Addr)
Else
Set SubNode10 = SubNode9.CreateChild(Codice,Descr,Ubi,Addr)
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Rs.MoveNext
Loop
End If
MyTree2.Draw()
Set MyTree2 = Nothing
%>