TAdodataSet.Create(self)显示"Undeclared indentifier:

10 | 问答知识库用户 |浏览270次
收藏|2014/05/17 22:00
CreateSubTree(fieldbyname('flag').AsInteger +1,mLocalName,TreeNode);
         Next;    end;
         finally
         Ado_Tree.Free;        end; end;
         begin
         TreeView.Items.BeginUpdate;
         TreeView.Items.Clear;
         Ado_Tree:=TADODataSet.Create(Self);
         Ado_Tree.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Fo;Data Source=SR008';
         with Ado_Tree do
         try
         Close;
         CommandText:='select * form t_unit where flag=1 order by no';
         Open;
         First;
         while not eof do
         begin
         TreeNode:=TreeView.Items.Add(nil,trim(fieldbyname('no').AsString )+'-'+trim(fieldbyname('name').AsString ));
         TreeNode.ImageIndex :=0;
         CreateSubTree(fieldbyname('flag').AsInteger +1,fieldbyname('no').AsString ,Treenode);
         next;  end; finally     Ado_Tree.Free;
         end;
     TreeView.Items.Endupdate;

满意回答

2014/05/18 09:31

需要在 TComponent继承下的类方法里面才可以用self的

热心网友

其他回答(0)
0人关注该问题
待解决问题



+1
 加载中...