unit2.pas

来自「delphi典型实验代码」· PAS 代码 · 共 49 行

PAS
49
字号
unit Unit2;

interface

uses              
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation
uses unit3, Unit1;
{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
var str:string;
begin
  str:='select * from 学生基本信息表 where 学号='
        +''''+edit1.Text+''''
        +' and '+'姓名='+''''+edit2.Text+'''';
  with  DataModule3.ADOQuery1 do
  begin
    Close;
    SQL.Clear;
    SQL.Add(str);
    open;
  end;
  if  DataModule3.ADOQuery1.RecordCount>0 then
    form1.show;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?