📄 unit5.~pas
字号:
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, ADODB;
type
TForm5 = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
GroupBox2: TGroupBox;
RadioButton3: TRadioButton;
GroupBox3: TGroupBox;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
GroupBox4: TGroupBox;
RadioButton6: TRadioButton;
Button1: TButton;
Button2: TButton;
ruler5Qry: TADOQuery;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
uses Unit7;
{$R *.dfm}
procedure TForm5.Button1Click(Sender: TObject);
begin
with ruler5Qry do
begin
close;
with sql do
begin
clear;
add('delete from fact_table');
end;
execsql;
end;
with ruler5Qry do
begin
close;
with sql do
begin
clear;
add('update pre_table set known=0 where known=1');
end;
execsql;
end;
with ruler5Qry do
begin
close;
with sql do
begin
clear;
add('update act_table set known=0 where known=1');
end;
execsql;
end;
Application.Terminate;
end;
procedure TForm5.Button2Click(Sender: TObject);
begin
ruler5Qry.Close;
//将事实加入事实库fact_table
if (radioButton1.Checked) then
begin
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'30'+') ' );
ruler5Qry.ExecSQL;
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'31'+') ' );
ruler5Qry.ExecSQL;
end
else if (radioButton2.Checked) then
begin
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'33'+') ' );
ruler5Qry.ExecSQL;
end
else if (radioButton3.Checked) then
begin
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'38'+') ' );
ruler5Qry.ExecSQL;
end;
if (radioButton4.Checked) then
begin
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'34'+') ' );
ruler5Qry.ExecSQL;
end
else if (radioButton5.Checked) then
begin
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'36'+') ' );
ruler5Qry.ExecSQL;
end;
if (radioButton6.Checked) then
begin
ruler5Qry.SQL.Clear;
ruler5Qry.sql.add('insert into fact_table values('+'39'+') ' );
ruler5Qry.ExecSQL;
end ;
Form5.Close;
Form7.show;
end;
procedure TForm5.FormShow(Sender: TObject);
begin
RadioButton1.Checked:=false;
RadioButton2.Checked:=false;
RadioButton3.Checked:=false;
RadioButton4.Checked:=false;
RadioButton5.Checked:=false;
RadioButton6.Checked:=false;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -