📄 informationright.pas
字号:
unit informationright;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ADODB, DB, Grids, DBGrids;
type
TForm10 = class(TForm)
Panel1: TPanel;
Bevel1: TBevel;
Bevel2: TBevel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label13: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Bevel3: TBevel;
Bevel4: TBevel;
Label9: TLabel;
DBGrid1: TDBGrid;
Memo1: TMemo;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button1: TButton;
ComboBox1: TComboBox;
Button7: TButton;
ADOTable1: TADOTable;
DataSource1: TDataSource;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form10: TForm10;
implementation
uses doublesystem;
{$R *.dfm}
procedure TForm10.Button2Click(Sender: TObject);
begin
adoquery1.Prior;
end;
procedure TForm10.Button1Click(Sender: TObject);
begin
adoquery1.First;
end;
procedure TForm10.Button3Click(Sender: TObject);
begin
adoquery1.Next;
end;
procedure TForm10.Button4Click(Sender: TObject);
begin
adoquery1.Last;
end;
procedure TForm10.Button6Click(Sender: TObject);
begin
button1.Enabled:=false;
button2.Enabled :=false;
button3.Enabled:=false;
button4.Enabled :=false;
memo1.Text:='';
combobox1.Text:='';
label7.Caption :='';
label6.Caption:='';
label5.Caption:='';
adotable1.Active:=false;
adoquery1.Active:=false;
form10.Close;
end;
procedure TForm10.Button5Click(Sender: TObject);
var
i1,i2:integer;
count:real;
s:string;
begin
if (combobox1.Text ='')or(memo1.text='') then
application.MessageBox('请选择信息集,SQL查询的语句例如:selete* from 表名 where 条件','提示',32)
else
begin
i1:=adotable1.RecordCount;
label5.Caption:=inttostr(i1);
adoquery1.Active:=false;
adoquery1.sql.Clear;
adoquery1.sql.Add(memo1.Text);
adoquery1.SQL:=memo1.Lines;
adoquery1.Active:=true;
i2:=adoquery1.RecordCount;
label6.Caption:=inttostr(i2);
if i2=0 then
showmessage('库中没有您想要统计的数据!请确认输入的正确性!');
count:=i2/i1;
count:=count*100;
str(count:8:2,s);
label7.Caption:=s+'%';
button1.Enabled:=true;
button2.Enabled :=true;
button3.Enabled:=true;
button4.Enabled :=true;
end;
end;
procedure TForm10.Button7Click(Sender: TObject);
begin
button1.Enabled:=false;
button2.Enabled :=false;
button3.Enabled:=false;
button4.Enabled :=false;
memo1.Text:='';
combobox1.Text:='';
label7.Caption :='';
label6.Caption:='';
label5.Caption:='';
adoquery1.Active:=false;
memo1.SetFocus;
end;
procedure TForm10.ComboBox1Change(Sender: TObject);
begin
case combobox1.ItemIndex of
0:begin
adotable1.Active :=false;
adotable1.TableName:='a01';
adotable1.Active :=true;
end;
1:begin
adotable1.Active :=false;
adotable1.TableName:='a02';
adotable1.Active :=true;
end;
2:begin
adotable1.Active :=false;
adotable1.TableName:='a03';
adotable1.Active :=true;
end;
3:begin
adotable1.Active :=false;
adotable1.TableName:='a04';
adotable1.Active :=true;
end;
4:begin
adotable1.Active :=false;
adotable1.TableName:='a05';
adotable1.Active :=true;
end;
5:begin
adotable1.Active :=false;
adotable1.TableName:='a06';
adotable1.Active :=true;
end;
6:begin
adotable1.Active :=false;
adotable1.TableName:='a07';
adotable1.Active :=true;
end;
7:begin
adotable1.Active :=false;
adotable1.TableName:='a08';
adotable1.Active :=true;
end;
8:begin
adotable1.Active :=false;
adotable1.TableName:='a09';
adotable1.Active :=true;
end;
9:begin
adotable1.Active :=false;
adotable1.TableName:='a10';
adotable1.Active :=true;
end;
10:begin
adotable1.Active :=false;
adotable1.TableName:='a11';
adotable1.Active :=true;
end;
11:begin
adotable1.Active :=false;
adotable1.TableName:='a12';
adotable1.Active :=true;
end;
12:begin
adotable1.Active :=false;
adotable1.TableName:='a13';
adotable1.Active :=true;
end;
13:begin
adotable1.Active :=false;
adotable1.TableName:='a14';
adotable1.Active :=true;
end;
14:begin
adotable1.Active :=false;
adotable1.TableName:='a15';
adotable1.Active :=true;
end;
15:begin
adotable1.Active :=false;
adotable1.TableName:='a16';
adotable1.Active :=true;
end;
16:begin
adotable1.Active :=false;
adotable1.TableName:='a17';
adotable1.Active :=true;
end;
17:begin
adotable1.Active :=false;
adotable1.TableName:='a18';
adotable1.Active :=true;
end;
18:begin
adotable1.Active :=false;
adotable1.TableName:='a19';
adotable1.Active :=true;
end;
19:begin
adotable1.Active :=false;
adotable1.TableName:='a20';
adotable1.Active :=true;
end;
20:begin
adotable1.Active :=false;
adotable1.TableName:='a21';
adotable1.Active :=true;
end;
21:begin
adotable1.Active :=false;
adotable1.TableName:='a22';
adotable1.Active :=true;
end;
22:begin
adotable1.Active :=false;
adotable1.TableName:='a23';
adotable1.Active :=true;
end;
23:begin
adotable1.Active :=false;
adotable1.TableName:='a24';
adotable1.Active :=true;
end;
24:begin
adotable1.Active :=false;
adotable1.TableName:='a25';
adotable1.Active :=true;
end;
25:begin
adotable1.Active :=false;
adotable1.TableName:='a26';
adotable1.Active :=true;
end;
26:begin
adotable1.Active :=false;
adotable1.TableName:='a27';
adotable1.Active :=true;
end;
27:begin
adotable1.Active :=false;
adotable1.TableName:='a28';
adotable1.Active :=true;
end;
28:begin
adotable1.Active :=false;
adotable1.TableName:='a29';
adotable1.Active :=true;
end;
29:begin
adotable1.Active :=false;
adotable1.TableName:='a30';
adotable1.Active :=true;
end;
30:begin
adotable1.Active :=false;
adotable1.TableName:='a31';
adotable1.Active :=true;
end;
31:begin
adotable1.Active :=false;
adotable1.TableName:='a32';
adotable1.Active :=true;
end;
32:begin
adotable1.Active :=false;
adotable1.TableName:='a33';
adotable1.Active :=true;
end;
33:begin
adotable1.Active :=false;
adotable1.TableName:='a34';
adotable1.Active :=true;
end;
34:begin
adotable1.Active :=false;
adotable1.TableName:='a35';
adotable1.Active :=true;
end;
35:begin
adotable1.Active :=false;
adotable1.TableName:='a36';
adotable1.Active :=true;
end;
36:begin
adotable1.Active :=false;
adotable1.TableName:='a37';
adotable1.Active :=true;
end;
37:begin
adotable1.Active :=false;
adotable1.TableName:='a38';
adotable1.Active :=true;
end;
38:begin
adotable1.Active :=false;
adotable1.TableName:='a39';
adotable1.Active :=true;
end;
39:begin
adotable1.Active :=false;
adotable1.TableName:='a40';
adotable1.Active :=true;
end;
40:begin
adotable1.Active :=false;
adotable1.TableName:='a41';
adotable1.Active :=true;
end;
41:begin
adotable1.Active :=false;
adotable1.TableName:='a42';
adotable1.Active :=true;
end;
end;
end;
procedure TForm10.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Button6.Click;
end;
procedure TForm10.FormActivate(Sender: TObject);
begin
memo1.SetFocus;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -