ASP 递归调用 已知节点查找根节点的函数
程序员文章站
2022-06-24 16:12:26
复制代码 代码如下:function gettreerootid(pnodeid) getsql = "select note_id,parent_id from [t_t...
复制代码 代码如下:
function gettreerootid(pnodeid)
getsql = "select note_id,parent_id from [t_tree_demo] where note_id='"& pnodeid &"'"
set getrs = db.execute(getsql)
if not getrs.eof then
if trim(getrs("parent_id")) = "0" then
gettreerootid = trim(getrs("note_id"))
exit function
else
gettreerootid = gettreerootid(trim(getrs("parent_id")))
end if
else
gettreerootid = 0
exit function
end if
getrs.close
set getrs = nothing
end function
上一篇: PS怎么制作彩色斑点边缘的五角星?
下一篇: 观点新鲜,过来长姿势