problem med løkke i løkke
hej jeg har en problem jeg har dette dette her kode, som skal autogenerer en menu ud fra min DB og det så tildels også fint, problemet er at den kunne får en første underknap med under hver hovedet knap og jeg kan ikke lige se nogle fejl i de løkker jeg bruger, er der nogle der kan hjælpe!! koden er her:<!--#include file="components/asp/master_files/db/db_on.asp" -->
<!--#include file="xmlstart_slut.asp" -->
<%
Get_Btn_1_Id_SQL = "SELECT * FROM Btn_1 where Item_Deleted = 'no' and Btn_1_Status = 'published'"
Set Get_Btn_1_Id = Conn.Execute(Get_Btn_1_Id_SQL)
'Hvis der er nogle btn_1'er
if not Get_Btn_1_Id.EOF then
Do
Get_Btn_1_Text_SQL = "Select * From Btn_1_Text Where Language = 'US' and Btn_1_Id = '"& Get_Btn_1_Id("Btn_1_Id") &"'"
Set Get_Btn_1_Text = Conn.Execute(Get_Btn_1_Text_SQL)
If Not Get_Btn_1_Text.EOF Then
'Hvis der er en Btn_1_text hvis sprog eller id passer til btn_1
Get_Btn_1_Content_SQL = "Select * From Btn_1_Content Where Btn_1_Id = '"& Get_Btn_1_Id("Btn_1_Id") &"'"
set Get_Btn_1_Content = Conn.Execute(Get_Btn_1_Content_SQL)
Select Case Get_Btn_1_Content("Content_Type")
Case "Button"
'Hvis Btn_1_Content er knapper
B1 = "<" & "submenu label=""" & Get_Btn_1_Text("Btn_1_Text") & "" & """ style=""" & "style2" & """>"
Get_Btn_1_Sub_SQL = "Select * From Btn_1_Sub_1 Where Btn_1_Id = '"& Get_Btn_1_Id("Btn_1_Id") &"'"
Set Get_Btn_1_Sub = Conn.Execute(Get_Btn_1_Sub_SQL)
If Not Get_Btn_1_Sub.EOF Then
'Hvis der er nogle Btn_2 som Macher Btn_1
Do
Get_Btn_2_Id_SQL = "SELECT * FROM Btn_2 where Item_Deleted = 'no' and Btn_2_Status = 'published' and Btn_2_Id = '"& Get_Btn_1_Sub("Btn_2_Id") &"'"
Set Get_Btn_2_Id = Conn.Execute(Get_Btn_2_Id_SQL)
If Not Get_Btn_2_Id.EOF Then
Get_Btn_2_Text_SQL = "Select * From Btn_2_Text Where Language = 'US' and Btn_2_Id = '"& Get_Btn_2_Id("Btn_2_Id") &"'"
Set Get_Btn_2_Text = Conn.Execute(Get_Btn_2_Text_SQL)
If Not Get_Btn_2_Text.EOF Then
Get_Btn_2_Content_SQL = "Select * From Btn_2_Content Where Btn_2_Id = '"& Get_Btn_2_Id("Btn_2_Id") &"'"
set Get_Btn_2_Content = Conn.Execute(Get_Btn_2_Content_SQL)
Select Case Get_Btn_2_Content("Content_Type")
Case "Button"
'Hvis indholet er knapper
B2 = "<" & "submenu label=""" & Get_Btn_2_Text("Btn_2_Text") & "" & """ style=""" & "style2" & """>"
Get_Btn_2_Sub_SQL = "Select * From Btn_2_Sub_1 Where Btn_2_Id = '"& Get_Btn_2_Id("Btn_2_Id") &"'"
Set Get_Btn_2_Sub = Conn.Execute(Get_Btn_2_Sub_SQL)
If Not Get_Btn_2_Sub.EOF Then
'Hvis der er nogle Btn_2 som Macher Btn_1
Do
Get_Btn_3_Id_SQL = "SELECT * FROM Btn_3 where Item_Deleted = 'no' and Btn_3_Status = 'published' and Btn_3_Id = '"& Get_Btn_2_Sub("Btn_3_Id") &"'"
Set Get_Btn_3_Id = Conn.Execute(Get_Btn_3_Id_SQL)
If Not Get_Btn_3_Id.EOF Then
Get_Btn_3_Text_SQL = "Select * From Btn_3_Text Where Language = 'US' and Btn_3_Id = '"& Get_Btn_3_Id("Btn_3_Id") &"'"
Set Get_Btn_3_Text = Conn.Execute(Get_Btn_3_Text_SQL)
If Not Get_Btn_3_Text.EOF Then
Get_Btn_3_Content_SQL = "Select * From Btn_3_Content Where Btn_3_Id = '"& Get_Btn_3_Id("Btn_3_Id") &"'"
set Get_Btn_3_Content = Conn.Execute(Get_Btn_3_Content_SQL)
Select Case Get_Btn_3_Content("Content_Type")
Case "Button"
'Hvis indholet er knapper
Case "Htm"
'Hvis indholdet er htm content
Get_Btn_3_Htm_SQL = "Select * From Btn_3_HtmContent Where Btn_3_Id = '"& Get_Btn_3_Id("Btn_3_Id") &"'"
Set Get_Btn_3_Htm = Conn.Execute(Get_Btn_3_Htm_SQL)
Get_Htm_Id_SQL = "Select * From HtmContent Where HtmContent_Id = '"& Get_Btn_3_Htm("HtmContent_Id") &"'"
Set Get_Htm_Id = Conn.Execute(Get_Htm_Id_SQL)
B3 = "<" & "item label=""" & Get_Btn_3_Text("Btn_3_Text") & "" & """ href=""" & "page_content.asp?ConId=" & Get_Btn_3_Htm("HtmContent_Id") & "&ConType=htm&Fla=" & Get_Htm_Id("Flash_Content") & """/>" & "</submenu>"
Case else
'Hvis indholdet er Asp content
Get_Btn_3_Asp_SQL = "Select * From Btn_3_AspContent Where Btn_3_Id = '"& Get_Btn_3_Id("Btn_3_Id") &"'"
Set Get_Btn_3_Asp = Conn.Execute(Get_Btn_3_Asp_SQL)
Get_Asp_Id_SQL = "Select * From AspContent Where AspContent_Id = '"& Get_Btn_3_Htm("AspContent_Id") &"'"
Set Get_Asp_Id = Conn.Execute(Get_Asp_Id_SQL)
B3 = "<" & "item label=""" & Get_Btn_3_Text("Btn_3_Text") & "" & """ href=""" & "page_content.asp?ConId=" & Get_Btn_3_Asp("AspContent_Id") & "&ConType=asp" & """/>" & "</submenu>"
End Select
Else
'Hvis Btn_2 Knappens Sprog er forkert
End if
Else
'Hvis Btn_2 knappen er deleted eller unpublished
End If
Get_Btn_2_Sub.MoveNext
Loop While Not Get_Btn_2_Sub.EOF
Else
'Hvis det ikke er nogle btn_2 som macher Btn_1
End If
Case "Htm"
'Hvis indholdet er htm content
Get_Btn_2_Htm_SQL = "Select * From Btn_2_HtmContent Where Btn_2_Id = '"& Get_Btn_2_Id("Btn_2_Id") &"'"
Set Get_Btn_2_Htm = Conn.Execute(Get_Btn_2_Htm_SQL)
Get_Htm_Id_SQL = "Select * From HtmContent Where HtmContent_Id = '"& Get_Btn_2_Htm("HtmContent_Id") &"'"
Set Get_Htm_Id = Conn.Execute(Get_Htm_Id_SQL)
B2 = "<" & "item label=""" & Get_Btn_2_Text("Btn_2_Text") & "" & """ href=""" & "page_content.asp?ConId=" & Get_Btn_2_Htm("HtmContent_Id") & "&ConType=htm&Fla=" & Get_Htm_Id("Flash_Content") & """/>" & "</submenu>"
B3=""
Case else
'Hvis indholdet er Asp content
Get_Btn_2_Asp_SQL = "Select * From Btn_2_AspContent Where Btn_2_Id = '"& Get_Btn_2_Id("Btn_2_Id") &"'"
Set Get_Btn_2_Asp = Conn.Execute(Get_Btn_2_Asp_SQL)
Get_Asp_Id_SQL = "Select * From AspContent Where AspContent_Id = '"& Get_Btn_2_Htm("AspContent_Id") &"'"
Set Get_Asp_Id = Conn.Execute(Get_Asp_Id_SQL)
B2 = "<" & "item label=""" & Get_Btn_2_Text("Btn_2_Text") & "" & """ href=""" & "page_content.asp?ConId=" & Get_Btn_2_Asp("AspContent_Id") & "&ConType=asp" & """/>" & "</submenu>"
B3 = ""
End Select
Else
'Hvis Btn_2 Knappens Sprog er forkert
End if
Else
'Hvis Btn_2 knappen er deleted eller unpublished
End If
Get_Btn_1_Sub.MoveNext
Loop While Not Get_Btn_1_Sub.EOF
Else
'Hvis det ikke er nogle btn_2 som macher Btn_1
End If
Case "Htm"
'Hvis Btn_1_Content er htm
Get_Btn_1_Htm_SQL = "Select * From Btn_1_HtmContent Where Btn_1_Id = '"& Get_Btn_1_Id("Btn_1_Id") &"'"
Set Get_Btn_1_Htm = Conn.Execute(Get_Btn_1_Htm_SQL)
Get_Htm_Id_SQL = "Select * From HtmContent Where HtmContent_Id = '"& Get_Btn_1_Htm("HtmContent_Id") &"'"
Set Get_Htm_Id = Conn.Execute(Get_Htm_Id_SQL)
B1 = "<" & "item label=""" & Get_Btn_1_Text("Btn_1_Text") & "" & """ href=""" & "page_content.asp?ConId=" & Get_Btn_1_Htm("HtmContent_Id") & "&ConType=htm&Fla=" & Get_Htm_Id("Flash_Content") & """/>"
B2 = ""
B3 = ""
Case else
'Hvis Btn_1_Content er asp
Get_Btn_1_Asp_SQL = "Select * From Btn_1_AspContent Where Btn_1_Id = '"& Get_Btn_1_Id("Btn_1_Id") &"'"
Set Get_Btn_1_Asp = Conn.Execute(Get_Btn_1_Asp_SQL)
Get_Asp_Id_SQL = "Select * From AspContent Where AspContent_Id = '"& Get_Btn_1_Htm("AspContent_Id") &"'"
Set Get_Asp_Id = Conn.Execute(Get_Asp_Id_SQL)
B1 = "<" & "item label=""" & Get_Btn_1_Text("Btn_1_Text") & "" & """ href=""" & "page_content.asp?ConId=" & Get_Btn_1_Asp("AspContent_Id") & "&ConType=asp" & """/>"
B2 = ""
B3 = ""
End select
else
End If
Get_Btn_1_Id.MoveNext
Loop While Not Get_Btn_1_Id.EOF
%>
<!--#include file="xmcreate.asp" -->
<%
Else
'Hvis ikke der er en Btn_1
End If
%>
<!--#include file="components/asp/master_files/db/db_off.asp" -->