C
Christopher Brandsdal
Hi again!
now I realy have a problem..
I want om make a menu that expandes like the menu on http://www.eks.as
The menu should expand after a sertain ID in the querystring. The page you
are on should be bold..
The code works fine exept when I pass a ID that belongs to a "child" in the
menu.... Any idea???
here's what I got so far....
<html>
<head>
<title>default.asp</title>
</head>
<body>
<%
' Connection to the database / Datenbankverbindung
Dim ConnectString, conn
ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("../../Documents and Settings/All
Users/Dokumenter/portal.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
%>
<%DIm ID
ID = Request.Querystring("id") %>
<%
'Henter kategorier
Dim sqlMeny, rsMeny
sqlMeny = "SELECT * FROM Meny ORDER BY ID ASC"
Set rsMeny = Server.CreateObject("ADODB.Recordset")
rsMeny.Open sqlMeny, conn, 3, 3
do until rsMeny.Eof
If rsMeny("parent") = 0 Then
%>
<%= rsMeny("Navn") %><br>
<%
Else
End If
If CInt(rsMeny.Fields("ID").Value) = CInt(ID) Then
'Henter kategorier
Dim sqlUnder, rsUnder
sqlUnder = "SELECT * FROM Meny WHERE Parent = "& rsMeny("id") &" ORDER BY ID
ASC"
Set rsUnder = Server.CreateObject("ADODB.Recordset")
rsUnder.Open sqlUnder, conn, 3, 3
do until rsUnder.Eof
%>
--<%= rsUnder("Navn") %><br>
<%
rsUnder.MoveNext
Loop
Else
End If
%>
<%
rsMeny.MoveNext
Loop
'disconnect
conn.close
Set conn = Nothing
%>
</body>
</html>
Christopher Brandsdal
Norway
now I realy have a problem..
I want om make a menu that expandes like the menu on http://www.eks.as
The menu should expand after a sertain ID in the querystring. The page you
are on should be bold..
The code works fine exept when I pass a ID that belongs to a "child" in the
menu.... Any idea???
here's what I got so far....
<html>
<head>
<title>default.asp</title>
</head>
<body>
<%
' Connection to the database / Datenbankverbindung
Dim ConnectString, conn
ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("../../Documents and Settings/All
Users/Dokumenter/portal.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
%>
<%DIm ID
ID = Request.Querystring("id") %>
<%
'Henter kategorier
Dim sqlMeny, rsMeny
sqlMeny = "SELECT * FROM Meny ORDER BY ID ASC"
Set rsMeny = Server.CreateObject("ADODB.Recordset")
rsMeny.Open sqlMeny, conn, 3, 3
do until rsMeny.Eof
If rsMeny("parent") = 0 Then
%>
<%= rsMeny("Navn") %><br>
<%
Else
End If
If CInt(rsMeny.Fields("ID").Value) = CInt(ID) Then
'Henter kategorier
Dim sqlUnder, rsUnder
sqlUnder = "SELECT * FROM Meny WHERE Parent = "& rsMeny("id") &" ORDER BY ID
ASC"
Set rsUnder = Server.CreateObject("ADODB.Recordset")
rsUnder.Open sqlUnder, conn, 3, 3
do until rsUnder.Eof
%>
--<%= rsUnder("Navn") %><br>
<%
rsUnder.MoveNext
Loop
Else
End If
%>
<%
rsMeny.MoveNext
Loop
'disconnect
conn.close
Set conn = Nothing
%>
</body>
</html>
Christopher Brandsdal
Norway