📄 unit3.pas
字号:
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Unit1, Grids, DBGrids, StdCtrls, DB, DBTables;
type
TForm3 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Label1: TLabel;
DBGrid1: TDBGrid;
Button2: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
DataSource1: TDataSource;
Query1: TQuery;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
if radiobutton3.Checked then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * from book');
Query1.Open;
end;
if form3.RadioButton2.Checked then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * from book where 书名=:书名');
Query1.ParamByName('书名').AsString:=edit1.Text;
Query1.Open;
end;
if form3.RadioButton1.Checked then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * from book where 书号=:书号');
Query1.ParamByName('书号').AsString:=edit1.Text;
Query1.Open;
end;
if form3.RadioButton4.Checked then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * from book where 作者=:作者');
Query1.ParamByName('作者').AsString:=edit1.Text;
Query1.Open;
end;
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
form3.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -