unit UMain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, DAODatabase, DAOTlb;
type
TMainFrm = class(TForm)
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainFrm: TMainFrm;
implementation
{$R *.DFM}
procedure TMainFrm.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
__DBEngine35.CompactDatabase (OpenDialog1.FileName, ExtractFilePath (OpenDialog1.FileName) + 'compacted.mdb', '', 0, '');
end;
end;
procedure TMainFrm.FormCreate(Sender: TObject);
begin
if __DBEngine35 = nil then CreateEngine (Dao35, '');
end;
procedure TMainFrm.Button2Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
__DBEngine35.RepairDatabase (OpenDialog1.FileName);
end;
end;
end.