📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,comobj, StdCtrls, WinSkinData ;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
SkinData1: TSkinData;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
dbe:OleVariant;
s:string;
begin
s:=extractfilepath(application.ExeName);
if messagedlg('请保证售电软件没有运行,确定要压缩数据库吗?',mtconfirmation,[mbyes,mbno],0)=idyes then
begin
end
Else
Exit;
dbe:=CreateOleObject('dao.dbengine.36');
dbe.CompactDatabase(s+'zzic3.zrf',s+'aa.zrf','',0,';pwd=83O10l');
if not deletefile(s+'zzic3.zrf') then
begin
application.MessageBox('删除原文件失败!','注意: ',mb_ok) ;
exit;
end;
if not RenameFile(s+'aa.zrf',s+'ZZIC3.zrf') then
begin
application.MessageBox('修改压缩后文件名字失败!','注意: ',mb_ok) ;
exit;
end;
application.MessageBox(' 压缩成功!','恭喜: ',mb_ok) ;
close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -