unit DataModule;

interface

uses
  SysUtils, Classes, DB, ADODB, DBXpress, SqlExpr, FMTBcd, DBClient,
  Provider, DBTables;

type
  TDM = class(TDataModule)
    QueryOsoby: TQuery;
    dsOsoby: TDataSource;
    Database: TDatabase;
    QueryOsobyIDOSOBY: TIntegerField;
    QueryOsobyNAZWISKO: TStringField;
    QueryOsobyIMIE: TStringField;
    QueryOsobyDATAUR: TDateTimeField;
    QueryOsobyMCOWOSC: TStringField;
    QueryOsobyULICAINR: TStringField;
    QueryOsobyKODP: TStringField;
    QueryOsobyMIASTO: TStringField;
    QueryOsobyPESEL: TStringField;
    UpdateSQL: TUpdateSQL;
    P_CZYTELNICY: TStoredProc;
    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
  Database.Connected := true;
end;

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

end.

