%
sub Get_CalCats(Cal)
dim cc, sql, last, tmp, CatID, i, iEventType, CalWhere
cc="&"
if (Cal > 100) then
CalWhere = " AND (Cats2.CatId = " & Cal & ") "
else
CalWhere = ""
end if
sql = "SELECT Cats3.CatId, Cats.Cat, Cats1.Cat, Cats2.Cat, Cats3.Cat, CatType FROM ((((CatTypes RIGHT JOIN Cats As Cats3 ON Cats3.CatTypeId = CatTypes.CatTypeId) LEFT JOIN Cats As Cats2 ON Cats3.ParentId = Cats2.CatId) left JOIN Cats As Cats1 ON Cats2.ParentId = Cats1.CatId) LEFT JOIN Cats As Cats ON Cats1.ParentId = Cats.CatId) WHERE (Cats.ParentId is NULL) and (CatTypes.CatTypeId = 100)" & CalWhere & " ORDER BY (CatType " & cc & "Cats.Cat " & cc & " Cats1.Cat " & cc & " Cats2.Cat " & cc & " Cats3.Cat)"
'response.write sql
' response.end
set rs = cn.Execute(sql)
do until rs.EOF
'if last <> rs(5) then
' tmp = tmp + ""
' tmp = tmp + ""
'end if
tmp = tmp + "" & vbCRLF & chr(9) & chr(9)
'tmp = tmp + ""
last = rs(5)
rs.MoveNext
loop
rs.Close
response.write tmp
CatId = ""
end sub
sub get_MyMenu(MenuID,MyField,MyMatch)
dim sql
dim isSelected
redim arItems(2,30)
sql = "SELECT * FROM Cats WHERE CatTypeID = " & MenuID
'on error resume next
set rs = cn.Execute(sql)
'on error resume next
dim TheIndex
TheIndex=0
rs.movefirst
while not rs.eof
arItems(0,TheIndex) = rs("CatID")
arItems(1,TheIndex) = rs("Cat")
'response.write arItems(0,TheIndex) & " " & TheIndex & " = arItems(TheIndex)
"
TheIndex = TheIndex + 1
rs.movenext
wend
rs.Close
%>
<%
end sub
%>