f_depart_id.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:1k
- unit f_depart_id;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls, Buttons, DB, ADODB;
- type
- Tw_depart_id = class(TForm)
- data_depart_id: TDataSource;
- ado_depart_id: TADOQuery;
- ado_depart_iddepart_id: TStringField;
- ado_depart_iddepart_name: TStringField;
- Panel1: TPanel;
- Label1: TLabel;
- ComboBox1: TComboBox;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- w_depart_id: Tw_depart_id;
- implementation
- {$R *.dfm}
- procedure Tw_depart_id.FormCreate(Sender: TObject);
- begin
- ado_depart_id.Close;
- ado_depart_id.SQL.Clear;
- ado_depart_id.SQL.Add('select* from depart');
- ado_depart_id.Open;
- ado_depart_id.First;
- while not ado_depart_id.eof do
- begin
- combobox1.items.add(trim(ado_depart_id.fieldbyname('depart_id').asString)+' --- '+trim(ado_depart_id.fieldbyname('depart_name').asString));
- ado_depart_id.next;
- end;
- end;
- end.