多级反展和用途反展(顶层反展)的代码执行速度好艰难啊,大约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编辑过]