tror jeg fik noget jeg kan bruge her
http://www.obout.com/obout/index1.aspdet er et gratis komponent der kan styrer det for mig og der er sandelig et eksempel med.
<%@ Language="VBScript" %>
<%
Option Explicit
Response.Expires = 0
Const CONN_STRING = "Provider=microsoft.jet.oledb.4.0;data source=G:\wwwroot\MyNavigationMenu.mdb"
Dim oConn, oRec, oTree, HTML
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = CONN_STRING
oConn.Open
Set oRec = Server.CreateObject("ADODB.Recordset")
'####################################################################################
Function BuildTree(piParentKey)
'##Build Tree -- Builds each node recursively.
Dim poRec, psSQL, psParentID, psNodeID, psHTML, pbExpand, psImage
Set poRec = Server.CreateObject("ADODB.Recordset")
'Build query to extract data from the database for this parent
psSQL = "SELECT * FROM NAVIGATION_MENU WHERE NAV_PARENT = "& piParentKey & " ORDER BY NAV_TITLE"
poRec.Open psSQL, oConn, 0, 3
If Not (poRec.EOF and poRec.BOF) Then
'## Loop through each Record in this Recordset
'## If there are no child nodes for the parent node of this tree, then this loop
'## will not run.
Do While Not poRec.EOF
'## Create node information for this record
psNodeID = "A" & poRec("NAV_PKEY")
psParentID = "A" & poRec("NAV_PARENT")
psHTML = "<p style=""margin-left: 5px; margin-right: 5px;""><a href=""/default.asp?catid="& poRec("NAV_PKEY") & """>"& poRec("NAV_TITLE") & "</a>"
pbExpand = poRec("NAV_DEFAULT_STATE")
psImage = poRec("NAV_IMAGE")
oTree.Add psParentID, psNodeID, psHTML, pbExpand, psImage
'## Build tree for child nodes of this parent
BuildTree poRec("NAV_PKEY")
poRec.MoveNext
Loop
End If
poRec.Close
Set poRec = Nothing
End Function
'####################################################################################
Set oTree = Server.CreateObject("obout_ASPTreeView_XP.Tree")
'## Create root node of the menu
HTML = "<p style=""margin-left: 5px;"">MyNavigationMenu"
oTree.Add "root", "A0", HTML, True, "help_obook.gif"
'## Build tree
BuildTree 0
'## Find selected node
If Len(Request.QueryString("catid")) > 0 Then
oTree.SelectedNode_Id = "A"& Request.QueryString("catid")
End If
Response.Write oTree.HTML
Set oTree = Nothing
Set oRec = Nothing
Set oConn = Nothing
%>
<!-- END MENU BAR -->