首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

递归出父ID过程出错,请大家批点,该如何处理

2012-02-17 
递归出父ID过程出错,请大家批点表结构:ClassidParentClassID6239171788110目的是,通过递归调出所处结点以

递归出父ID过程出错,请大家批点
表结构:
Classid       ParentClassID
6239             17
17                 8
8                   1
1                   0

目的是,通过递归调出所处结点以上的所有父级ID的集合,请高手指点我的问题出在哪里,我实在想不通了!      


Function   GetPIDs(CID)
Set   Grs   =   Server.CreateObject( "ADODB.RecordSet ")
Grs.Open   "Select   ParentClassID   From   ClassTable   where   ClassID   =   ' "&Trim(CID)& " ' ",oConn,1
if   Not(Grs.bof   and   Grs.eof)   then
IDstr   =   Grs( "ParentClassID ")& ", "
if   Grs( "ParentClassID ")   =   0   then
GetPIDs   =   IDstr
exit   Function
else
  Call   GetPIDs(Grs( "ParentClassID "))
end   if
else
GetPIDs   =   IDstr
end   if
Grs.Close
Set   Grs   =   Nothing
GetPIDs   =   IDstr
End   Function

[解决办法]
点数有点儿少,再加点儿.^__________^

热点排行