+ -
当前位置:首页 → 问答吧 → ASP递归返回参数问题

ASP递归返回参数问题

时间:2011-09-01

来源:互联网

VB code

function RootClassID(id)
    if id <> "" then        
        set cls_t = server.CreateObject("adodb.recordset")
        sql="Select * from About where id="&id&" order by id desc"
        cls_t.open sql,conn,1,1
        if not cls_t.eof then
            Call RootClassID(cls_t("classid"))
            response.Write(cls_t("classid")&",")
            'RootClassID = cls_t("classid")
        if not cls_t.eof then cls_t.MoveNext
        end if
        cls_t.Close : set cls_t = Nothing
    end if
end function



如何采用response.Write(cls_t("classid")&",")能把所有数值打印出来
如果用'RootClassID = cls_t("classid") 为什么只返回一个参数,而且重点没用一直递归下去了!
各位高手帮忙看看呀!

作者: zhz691900169   发布时间: 2011-09-01

当然是一个值啦,你有没有用到循环。。。

作者: reciment   发布时间: 2011-09-01

VB code

function RootClassID(id)
    if id <> "" then        
        set cls_t = server.CreateObject("adodb.recordset")
        sql="Select * from About where id="&id&" order by id desc"
        cls_t.open sql,conn,1,1
        if not cls_t.eof then
            Call RootClassID(cls_t("classid"))
            if cls_t("classid") = 0 then
                'response.Write(cls_t("id"))
                RootClassID = cls_t("id")
            end if
            
        if not cls_t.eof then cls_t.MoveNext
        end if
        cls_t.Close : set cls_t = Nothing
    end if
end function


各位大侠重现看下代码
如果我判断,response.write是能打印出来,可是返回值就没了!
为什么呀?

作者: zhz691900169   发布时间: 2011-09-01

都没人顶呀!

作者: zhz691900169   发布时间: 2011-09-01

热门下载

更多