procedure TForm1.Button1Click(Sender: TObject);
var Node1,SubNode1:TTreeNode;
begin
adoquery1.Open;
node1:=treeview1.items.add(nil,'地址');
node1.selectedindex:=0;
while not adoquery1.Eof do
begin
subnode1:=treeview1.items.addchildobject(node1,adoquery1.FieldValues['地址'],nil);
subnode1.selectedindex:=adoquery1.recNo+1;
adoquery1.Next;
end;
adoquery1.Close;
end;
end.
其中地址为字段名,nil是什么意思?
adoconnetion adoquery连接完毕。
系统提示错误‘用户sa登陆失败‘。
是不是treeview的属性要设啊。