http://expert.csdn.net/Expert/topic/1878/1878830.xml?temp=.6941797

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1878/1878830.xml?temp=.6941797可惜,客户端不能对这个地址作出有效反映----------------
    沉沦中..........
      

  2.   

    http://expert.csdn.net/Expert/topic/1878/1878830.xml?temp=.299328    try
      

  3.   


    e2  1   aaa
    e2  2   abb
    e2  3   ccc
    e3  1   ad
    e3  2   dddatreeview1 已生成如下:
    e2  1
        2
        3
    e3  1
        2
    现点e2 1    //edit1 显示:aaa
           2    //edit1 显示:abb
    如何写代码?生成树的源码如下:
    procedure TForm1.FormCreate(Sender: TObject);
    var v_louno:string;
        node1:Ttreenode;
    begin
      with Query1 do
      begin
        close;
        sql.clear;
        sql.add('select louno from 表  group by louno');
        open;
        while not eof do
        begin
          v_luono:=fieldbyname('louno').asstring;
          node1:=treeview1.Items.AddChild(nil,v_luono);        
          with Query2 do
          begin
            close;
            sql.clear;
            sql.add('select distinct unitno from 表 where luono='''+v_louno+'''');
            open;
            while not eof do
            begin
              treeview1.Items.AddChild(node1,query2.fieldbyname('unitno').asstring);
              next;
            end;
            query2.close;
          end;
          next;
        end;
        close;
      end;
     end;
    表:
    louno unitno beizhu
    e2  1   aaa
    e2  2   abb
    e2  3   ccc
    e3  1   ad
    e3  2   ddda
      
    急,好心人写段源码,再加20分,共100分!!
      

  4.   

    若我使用的是ado

    v_luono:=fieldbyname('louno').asstring;
          node1:=treeview1.Items.AddChild(nil,v_luono);        
    会出现问题,怎么改好呢?