treeview
This.LineStyle= 1 && tvwRootLines This.Style= 7 && tvwTreelinesPlusMinusPictureText
This.ImageList=Thisform.Imagelist1 &&与Imagelist控件建立关联
*This.SingleSel=.t.
SELECT bm
SET DELETED ON
GO TOP
DO WHILE !EOF()
&&添加部门节点,以唯一的部门编号字段作为控件的Key
This.Nodes.Add(,,ALLTRIM(bm.bmdm),ALLTRIM(bm.bm),1,3)
*( 属于,子节点,名称,标题)节点的名称就用编号,子节点的属于就用节点的名称,就是bmdm。
SELECT wjmjs
SET DELETED ON
SET FILTER TO ALLTRIM(wjmjs.bmdm)=ALLTRIM(bm.bmdm)
GO TOP
&&添加部门中人员节点,以唯一的Key字段值作为控件的Key
DO WHILE !EOF()
This.Nodes.Add(ALLTRIM(bm.bmdm),4,ALLTRIM(wjmjs.Key),ALLTRIM(wjmjs.lxr),3,3) **********提示错误ole IDispatch 异常代码 0 出自Nodes: Key is not unique in collection
SKIP
ENDDO
SELECT bm
SKIP
ENDDO
SELECT wjmjs
SET FILTER TO
GO TOP
SELECT bm
GO TOP
数据库文件
新建文件夹.rar
(2.8 KB)