choosebook.~pas
来自「图书管理系统,使用Delphi开发,数据库为Microsoft SQL Serv」· ~PAS 代码 · 共 76 行
~PAS
76 行
unit ChooseBook;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit2, ADODB, ImgList, DB, Grids, DBGrids, ExtCtrls, StdCtrls,
Buttons, ComCtrls, ToolWin;
type
TChoose = class(TParent)
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Choose: TChoose;
implementation
{$R *.dfm}
procedure TChoose.BitBtn1Click(Sender: TObject);
var
condition:integer;
begin
inherited;
condition:=7;
if label3.Visible=false then
condition:=(condition)and(3);
if label4.Visible=false then
condition:=(condition)and(5);
if label5.Visible=false then
condition:=(condition)and(6);
if condition=7 then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from '+adotable1.TableName);
adoquery1.SQL.Add('where(BookInfo_No like ''%'+edit1.Text+'%'')');
adoquery1.SQL.Add('and(BookInfo_Author like ''%'+edit2.Text+'%'')');
adoquery1.SQL.Add('and(BookInfo_BookName like ''%'+edit3.Text+'%'')');
adoquery1.Open;
//
adotable1.Clone(adoquery1,ltUnspecified);
end;
if condition=6 then //
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from '+adotable1.TableName);
adoquery1.SQL.Add('where(BookInfo_No like ''%'+edit2.Text+'%'')');
adoquery1.SQL.Add('and(BookInfo_Author like''%'+edit2.Text+'%'')');
adoquery1.Open;
//
adotable1.Clone(adoquery1,ltUnspecified);
end;
if condition=4 then //
begin
adoquery1.Close;
adoquery1.SQL.Add('select * from '+adotable1.TableName);
adoquery1.SQL.Add(' where(BookInfo_No like ''%'+edit1.Text+'%'')');
adoquery1.Open;
//
adotable1.Clone(adoquery1,ltUnspecified);
end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?