📄 zjzdunit.pas
字号:
unit ZjZdUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Buttons;
type
TZjZdForm = class(TForm)
BitBtn2: TBitBtn;
Bevel1: TBevel;
BitBtn1: TBitBtn;
Label1: TLabel;
Edit1: TEdit;
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ZjZdForm: TZjZdForm;
implementation
uses DataTUnit, gzdata;
{$R *.DFM}
procedure TZjZdForm.BitBtn2Click(Sender: TObject);
begin
close;
end;
procedure TZjZdForm.BitBtn1Click(Sender: TObject);
var ssss:string;
begin
if length(edit1.text)=0 then abort;
IF (application.messagebox('你必须确认,输入的字段名称不存在,否则产生重复字段,进行吗?','消息框',mb_okcancel+mb_defbutton1+mb_iconquestion)
=idok) then
begin
datat.table1.open;
ssss:=edit1.text;
ssss:='ZJ'+ssss;
if datat.table1.FindField(ssss)<>nil then
begin
application.MessageBox('字段已经存在,请重新输入字段名称!!!','提示',mb_ok);
abort;
end;
data.Query1.Close;
with data.query1 do
begin
if datat.Table1.Active then datat.table1.close;
with sql do
begin
datat.table1.close;
clear;
add('alter table "LYK.dbf" add column');
add(ssss);
add('NUMERIC(10,2)');
end;
ExecSQL;
end;
application.messagebox('恭喜,恭喜,字段成功的产生完毕!!!','消息框',mb_ok+mb_iconinformation);
end;
end;
procedure TZjZdForm.FormShow(Sender: TObject);
begin
edit1.SetFocus;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -