Foxtable(狐表)用户栏目专家坐堂 → 请老师看一下下面的递归函数有什么问题?


  共有1879人关注过本帖平板打印复制链接

主题:请老师看一下下面的递归函数有什么问题?

帅哥哟,离线,有人找我吗?
xaay
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:32 积分:405 威望:0 精华:0 注册:2016/7/23 10:33:00
请老师看一下下面的递归函数有什么问题?  发帖心情 Post By:2017/3/2 10:09:00 [只看该作者]

 '调用函数:目的是为了取得上级部门和本部门名称组成的路径
MessageBox.Show(Functions.Execute("部门路径","109",""))

'函数------------------------------------------------------
Dim bmbh As String = Args(0)
Dim str As String =  Args(1)
Dim cmd As new SQLCommand
cmd.ConnectionName = gs_strActiveConn
cmd.CommandText="sel ect 部门编号,部门名称,上级部门编号,上级部门名称 from {公司部门表} where 部门编号 = '" & bmbh & "'"
Dim dt As DataTable = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
    Dim dr As DataRow = dt.DataRows(0)
    str = dr("部门名称") & "\" & str
    str = str.trim("\")
    If dr("上级部门编号").length > 0 Then
        Functions.Execute("部门路径",dr("上级部门编号"),str)
    End If
End If
Return str
'----------------------------------------------------------


 回到顶部