📄 unit3.~pas
字号:
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, ExtCtrls, DB, ADODB;
type
TFormdzcx = class(TForm)
Panel1: TPanel;
DBGriddzcx: TDBGrid;
GroupBox1: TGroupBox;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Editgjz: TEdit;
ComboBoxgjz: TComboBox;
DataSource1: TDataSource;
ADOConnection1: TADOConnection;
ADOQuerydzcx: TADOQuery;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Formdzcx: TFormdzcx;
implementation
{$R *.dfm}
procedure TFormdzcx.Button1Click(Sender: TObject);
var gjz,gjzsz:string;
begin
gjz:=comboboxgjz.Text;
gjzsz:=editgjz.Text;
if(gjz='')and(gjzsz='')then
with adoquerydzcx do
begin
close;
sql.Clear;
sql.Add('select*');
sql.Add('from dzmc');
sql.Add('order by jszh');
prepared;
open;
end
else if (gjz<>'')and(gjzsz='')then
showmessage('请输入''查询关键字设置''信息!')
else if (gjz='')and(gjzsz<>'')then
showmessage('请选择''查询关键字选择''信息!')
else
begin
if gjz='借书证号'then
with adoQuerydzcx do
begin
close;
sql.Clear;
sql.Add('select*');
sql.Add('from dzmc');
sql.Add('where jszh like :gjzszname');
sql.Add('order by jszh');
parameters.ParamByName('gjzszname').Value:=gjzsz;
prepared;
open;
end
else if gjz='读者姓名'then
with adoQuerydzcx do
begin
close;
sql.Clear;
sql.Add('select*');
sql.Add('from dzmc');
sql.Add('where xm like :gjzszname');
sql.Add('order by jszh');
parameters.ParamByName('gjzszname').Value:=gjzsz;
prepared;
open;
end
else if gjz='读者性别'then
with adoQuerydzcx do
begin
close;
sql.Clear;
sql.Add('select*');
sql.Add('from tsbm');
sql.Add('where xb like :gjzszname');
sql.Add('order by jszh');
parameters.ParamByName('gjzszname').Value:=gjzsz;
prepared;
open;
end
else if gjz='读者职业'then
with adoQuerydzcx do
begin
close;
sql.Clear;
sql.Add('select*');
sql.Add('from dzmc');
sql.Add('where zy like :gjzszname');
sql.Add('order by jszh');
parameters.ParamByName('gjzszname').Value:=gjzsz;
prepared;
open;
end
else if gjz='读者单位'then
with adoQuerydzcx do
begin
close;
sql.Clear;
sql.Add('select*');
sql.Add('from dzmc');
sql.Add('where dw like :gjzszname');
sql.Add('order by jszh');
parameters.ParamByName('gjzszname').Value:=gjzsz;
prepared;
open;
end;
end;
end;
procedure TFormdzcx.Button2Click(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -