📄 unit6.pas
字号:
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls;
type
TFormFWXXTJ = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;
Label2: TLabel;
Edit1: TEdit;
Label1: TLabel;
Label3: TLabel;
Edit2: TEdit;
Edit3: TEdit;
Label5: TLabel;
Edit4: TEdit;
Label7: TLabel;
Label4: TLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Label8: TLabel;
Edit5: TEdit;
Label6: TLabel;
Memo1: TMemo;
Panel2: TPanel;
BitBtn2: TBitBtn;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormFWXXTJ: TFormFWXXTJ;
implementation
uses unit3;
{$R *.dfm}
procedure TFormFWXXTJ.BitBtn1Click(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (edit3.Text<>'') and (edit4.Text<>'') and (edit5.Text<>'') then
begin
try
database.ADO_FWXX.Close;
database.ADO_FWXX.SQL.Clear;
database.ADO_FWXX.SQL.Add('insert 房屋信息表 values (:a,:b,:c,:d,:e,:f,:g,:h)');
database.ado_fwxx.parameters.parambyname('a').value:=trim(edit1.text);
database.ADO_FWXX.Parameters.parambyname('b').value:=combobox1.text;
database.ADO_FWXX.Parameters.parambyname('c').value:=edit2.Text;
database.ADO_FWXX.Parameters.parambyname('d').value:=combobox2.Text;
database.ADO_FWXX.Parameters.parambyname('e').value:=strtodatetime(edit3.Text);
database.ADO_FWXX.Parameters.parambyname('f').value:=edit4.Text;
database.ADO_FWXX.Parameters.parambyname('g').value:=edit5.Text;
database.ADO_FWXX.Parameters.parambyname('h').value:=memo1.Text;
database.ADO_FWxx.execsql;
application.MessageBox('添加成功','提示',64);
database.ADO_FWXX.Connection:=database.ADOConnection1;
with database.ADO_FWXX do
begin
close;
sql.Clear;
sql.Add('select * from 房屋信息表');
open;
end;
formfwxxtj.Close;
except
application.MessageBox('添加失败','提示',64);
formfwxxtj.Close;
end
end
else
begin
application.MessageBox('字段不能为空,添加失败!','提示',64);
formfwxxtj.Close;
end;
end;
procedure TFormFWXXTJ.BitBtn2Click(Sender: TObject);
begin
formfwxxtj.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -