如何通过数据表设置treeview的子节点
以下为本个编写的treeview 的子节点代码,运行时出错,提示异常代码0,出自nodes:element not found,由于本人新学习应用,不知道哪里不对,求高手指点1 this.lineStyle= 1 && tvwRootLines
2 this.style= 7 && tvwTreelinesPlusMinusPictureText
3 this.ImageList=thisform.imagelist1
4 SELECT * FROM department WHERE subdir=0 INTO CURSOR bm_temp0
5 SELECT * FROM department WHERE subdir=1 INTO CURSOR bm_temp1
6 SELECT * FROM department WHERE subdir=2 INTO CURSOR bm_temp2
7 SELECT * FROM department WHERE subdir=3 INTO CURSOR bm_temp3
8 SELECT bm_temp0
9 this.Nodes.Add(,,ALLTRIM(bmmc),bmmc,1) &&江苏飞船
10 SELECT bm_temp1
11 DO WHILE !EOF()
12 this.Nodes.Add(ALLTRIM(bm_temp0.bmmc),4,ALLTRIM(bm_temp1.bmmc),ALLTRIM(bm_temp1.bmmc),2) &&飞船公司目录
13 SELECT bm_temp2
14 DO WHILE !EOF()
15 this.Nodes.Add(ALLTRIM(bm_temp1.bmmc),4,bm_temp2.bmmc,bm_temp2.bmmc,3) &&key--部门名称
16 SELECT bm_temp3
17 SET FILTER TO ALLTRIM(parentname)=ALLTRIM(bm_temp2.bmmc)
18 DO WHILE !EOF()
19 this.Nodes.Add(ALLTRIM(bm_temp2.bmmc),4,bmmc,bmmc,4)
20 SKIP
21 ENDDO
22 SELECT bm_temp2
23 SKIP
24 ENDDO
25 SELECT bm_temp1
26 SKIP
27 ENDDO
department.rar
(827 Bytes)