unit DataModule;

interface

uses
  SysUtils, Classes, DB, DBTables, Forms;

type
  TDM = class(TDataModule)
    Database: TDatabase;
    TableXBase: TTable;
    dsXBase: TDataSource;
    procedure DataModuleCreate(Sender: TObject);
    procedure DataModuleDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DM: TDM;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TDM.DataModuleCreate(Sender: TObject);
begin
   try
      Database.Connected := True;
      TableXBase.Open();
   except
      raise;
   end;
end;

procedure TDM.DataModuleDestroy(Sender: TObject);
begin
   TableXBase.Close();
   Database.Connected := False;
end;

end.
