buenas chi@s, estoy intentando implementar un codigo que me enviaron para hacer menus en forma de arbol.
tengo un problema a la hora de adaptar el codigo ya que yo programo desde dreamweaver y de asp ( basico ) las conexiones de dreamweaver son muy diferentes a las que me mandan en el codigo os mando el codigo de la página ( ojo !!! dentro del codigo esta el que me mandaron " copiar pegar " asi que no modifique nada ) a parte de esto cree un recorset en dreamweaver para que vierais la diferencia.
muchas gracias espero que alguien me haya entendido ....
Código:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="file:///C|/inetpub/wwwroot/WG/Connections/conwg3.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conwg3_STRING
Recordset1.Source = "SELECT * FROM wg3menu"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("basemenu.mdb"))
%>
<table border="0" width="200" id="table1">
<%
SQL = "SELECT * FROM tablamenu01 order by nombre ASC"
Set objRS = oConn.Execute(SQL)
if objRS.bof and objRS.eof then
Response.write "Estamos dando mantenimiento al menú"
else
%>
<%
while (not objRS.Eof)
cod_menu01 = objRS("cod_menu01")
%>
<tr>
<td width="15" valign="top"><b>*</b></td>
<td valign="top">
<%=objRS("nombre")%>
<%
SQL2 = "SELECT * FROM tablamenu02 where cod_menu01 = '" & cod_menu01 & "' order by nombre ASC"
Set objRS2 = oConn.Execute(SQL2)
if objRS2.bof and objRS2.eof then
'no hacemos nada
else
%>
<table border="0" id="table1">
<%
while (not objRS2.Eof)
cod_menu02 = objRS2("cod_menu02")
%>
<tr>
<td width="15" valign="top"><b>**</b></td>
<td valign="top">
<%=objRS2("nombre")%>
<%
SQL3 = "SELECT * FROM tablamenu03 where cod_menu02 = '" & cod_menu02 & "' order by nombre ASC"
Set objRS3 = oConn.Execute(SQL3)
if objRS2.bof and objRS2.eof then
'no hacemos nada
else
%>
<table border="0" id="table1">
<%
while (not objRS3.Eof)
%>
<tr>
<td width="10" valign="top"><b>***</b></td>
<td valign="top"><%=objRS3("nombre")%></td>
</tr>
<%
objRS3.MoveNext
wend
%>
<%
end if
objRS3.Close
set objRS3 = nothing
%>
</table>
</td>
</tr>
<%
objRS2.MoveNext
wend
%>
<%
end if
objRS2.Close
set objRS2 = nothing
%>
</table>
</td>
</tr>
<%
objRS.MoveNext
wend
%>
<%
end if
objRS.Close
set objRS = nothing
oConn.Close
set oConn = nothing
%>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>