
07/08/2007, 04:37
|
| | Fecha de Ingreso: abril-2002
Mensajes: 68
Antigüedad: 22 años, 11 meses Puntos: 0 | |
menu dinamico necesito una ayuda : utilizo dreamweaver para programar con asp y me dieron un codigo para crear un arbol dinamico de menus. el problema que tengo es que no se como utilizarlo con las conexiones que realiza el dreamweaver. Alguien puede ayudarme ??
el codigo que me dieron Cita: <%
Call DoTree(0,0)
'here we initially call the sub routine, we pass 0 as the parent ID
'this will pull all top level parent (meaning they don't have an 'ancestor).
'we also pass 0 for the level, this is used for spacing, or
'making the results appear threaded.
'----------------------------------------------------------
Sub DoTree(ParentID, intLevel)
Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open var_cadena_de_conexion
Dim SQLQ, DBConn, rs, i
SQLQ = "SELECT RecordID, DisplayName FROM RECORDS " & _
"WHERE ParentID = " & ParentID & " ORDER BY DisplayName ASC"
Set rs = DBConn.Execute(SQLQ)
If Not rs.EOF Then
Do Until rs.EOF
' Response.Write "<img src=Spacer.gif Width= " & _
' 15 * intLevel & ">"
Response.Write Replace(Space(intLevel), " ", " ")
Response.Write rs("DisplayName") & "<br>"
'now call the subroutine we're in to see if this value has
'any children and increase the indent, and so on...
DoTree rs("RecordID"), intLevel + 1
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
DBConn.Close
Set DBConn= Nothing
End Sub
'------------------------------------------------------------
%>
__________________ Lordztein |