
21/09/2005, 18:21
|
 | Colaborador | | Fecha de Ingreso: octubre-2003
Mensajes: 2.393
Antigüedad: 21 años, 4 meses Puntos: 27 | |
codigo para tu menu en forma de arbol te hice el codigo pero cambie un poco la estructura de las tablas que te mensione en el post anterior
codigo en asp con base de datos access
saludos base de datos
si queres la base mandame un mensaje y te la paso por correo o por MSN, porque no encontre la forma de publicarla en el foro y no me quedo tiempo de averiguarlo. Codigo
<%
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>
__________________ JuanRa Pérez
San Salvador, El Salvador |