📄 unit23.pas
字号:
unit Unit23;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids,unit10, DB, ADODB;
type
TForm23 = class(TForm)
GroupBox1: TGroupBox;
DBGrid1: TDBGrid;
RadioGroup1: TRadioGroup;
Edit1: TEdit;
Button1: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
DataSource1: TDataSource;
ADOQuery1: TADOQuery;
ADOTable1: TADOTable;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form23: TForm23;
implementation
{$R *.dfm}
procedure TForm23.Button1Click(Sender: TObject);
var
a:boolean;
begin
a:=adotable1.Locate('姓名',trim(edit1.Text),[]);
if a then
begin
adoquery1.Active:=false;
adoquery1.Close;
if radiobutton1.Checked then
begin
adoquery1.SQL.Text:='select * from base_info where id='+adotable1.FieldByName('ID').AsString;
end;
if radiobutton2.Checked then
begin
adoquery1.SQL.Text:='select * from work_info where pid='+adotable1.FieldByName('ID').AsString;
end;
if radiobutton3.Checked then
begin
adoquery1.SQL.Text:='select * from study_info where pid='+adotable1.FieldByName('ID').AsString;
end;
if radiobutton4.Checked then
begin
adoquery1.SQL.Text:='select * from train_info where pid='+adotable1.FieldByName('ID').AsString;
end;
if radiobutton5.Checked then
begin
adoquery1.SQL.Text:='select * from jc_info where pid='+adotable1.FieldByName('ID').AsString;
end;
if radiobutton6.Checked then
begin
adoquery1.SQL.Text:='select * from lz_info where 姓名='''+trim(adotable1.FieldByName('姓名').AsString)+'''';
end;
adoquery1.Open;
adoquery1.Active:=true;
end
else
adoquery1.Active:=false;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -