unit Unmenu;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, DB, ADODB;
type TForm1 = class(TForm) TreeView1: TTreeView; Button1: TButton; ADOConnection1: TADOConnection; ADODataSet1: TADODataSet; Button2: TButton; procedure Button2Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject); begin close; end;
procedure TForm1.FormCreate(Sender: TObject); var root:ttreenode; aa,bb,aa1,bb1:string; i,m,n:integer; begin treeview1.Items.Clear; i:=0; m:=0; n:=0; with adodataset1 do begin active:=false; commandtext:='select * from youbian'; active:=true; m:=recordcount; treeview1.Items.add(nil,fieldbyname('shengfen').asstring); for i:=1 to m do begin aa:=fieldbyname('shengfen').asstring; next; bb:=fieldbyname('shengfen').asstring; if aa<>bb then treeview1.Items.add(nil,bb); end; active:=false; end; file://添加省份 end;
procedure TForm1.Button1Click(Sender: TObject); begin
end;
end.