<!--#include virtual="inc/General.inc.asp"-->
<%
MenuCode = replace(Request("MenuCode"),"'","''")
if MenuCode="" then Response.Redirect "Menu.asp"
set rs = server.createobject("adodb.recordset")
rs.open "select * from Menu where len(MenuCode)=" & len(MenuCode) & " and MenuCode<>'" & MenuCode & "' and left(MenuCode," & len(MenuCode)-2 & ")='" & left(MenuCode,len(MenuCode)-2) & "'",conn,1,3
if rs.eof then
	conn.execute "update Menu set SubKey=0 where MenuCode='" & left(MenuCode,len(MenuCode)-2) & "'"
end if
conn.execute "delete * from Menu where left(MenuCode," & len(MenuCode) & ")='" & MenuCode & "'"
conn.execute "delete * from Content where MenuCode='" & MenuCode & "'"
CreateMenu()
CloseConnection()
ErrorInfos "deleted!","Menu.asp"
%>