procedure showtv
var myNode:TTreeNode
begin
treeview1.Items.Clear;
rootnode:=treeview1.Items.Add(nil,'信息');
with ADODataSet1 do
begin
Open;first;
[red]/// new(TmpNodeData);[/red]
while not eof do
begin
[red] new(TmpNodeData);[/red]
TmpNodeData^.NodeId:=fieldbyname('省份id').AsInteger;
myNode:=Treeview1.Items.AddChild(rootnode,fieldbyname('省份名称').AsString);
myNode.Data:=TmpNodeData;
next;
end;
close;
end;