codice:
function deleteChilds(cn,valueID)
loopFunction = false
s = "SELECT IDMenu FROM Tabella WHERE IDPadre = " & valueID
set r = cn.execute(s)
if not r.eof then
loopFunction = true
tempID = r("IDMenu")
end if
r.close
set r = nothing
cn.execute("DELETE * FROM Tabella WHERE IDMenu = " & valueID
if loopFunction then deleteChilds cn, tempID
end function

id = request.form("id")
set conn = ...
conn.open ...

...
if len(id) > 0 and isNumeric(id) then deleteChilds conn, id

...

conn.close
set conn = nothing