Foxtable(狐表)用户栏目专家坐堂 → BOM数据展开,制造业的高手请进!


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

主题:BOM数据展开,制造业的高手请进!

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


加好友 发短信
等级:四尾狐 帖子:928 积分:7769 威望:0 精华:13 注册:2008/9/1 11:58:00
  发帖心情 Post By:2010/4/18 11:09:00 [只看该作者]

多级反展和用途反展(顶层反展)的代码执行速度好艰难啊,大约2分钟,太慢了,另外这两个功能的代码为什么会报错呢,代码如下:
dim al as string=Forms("frm_b").Controls("TextBox1").value
'多级反展:
 Dim s As String =  " ;with cte As "  & _
    "(select * from abt00000 where childitem = '"  & al  & "'  "  & _
    "union all  "  & _
    "select a.* from abt00000 a  "  & _
    "join cte on a.childitem  = cte.parentitem) "  & _
    "select  * from cte "
    tables("frm_b_table1").Fill(s,"erp",true)

'用途反展:
Dim s As String =  " ;with cte As "  & _
    "(select * from abt00000 where childitem = '"  & al  & "'  "  & _
    "union all  "  & _
    "select a.* from abt00000 a  "  & _
    "join cte on a.childitem  = cte.parentitem) "  & _
    "select  * from cte left join abt00000 b on cte.parentitem = b.childitem where b.childitem is null"
    tables("frm_b_table1").Fill(s,"erp",true)



图片点击可在新窗口打开查看此主题相关图片如下:pic089.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2010-4-18 11:09:13编辑过]

 回到顶部
总数 40 1 2 3 4 下一页