实现代码如下:

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

以上就是【ASP 递归调用 已知节点查找根节点的函数】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论