unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DBCtrls, StdCtrls, Grids, DBGrids, DB, DBTables, ExtCtrls, ExtDlgs,
  RpCon, RpConDS, RpDefine, RpRave;

type
  TForm1 = class(TForm)
    DataSource1: TDataSource;
    Table1: TTable;
    DBGrid1: TDBGrid;
    DBMemo1: TDBMemo;
    DBImage1: TDBImage;
    DBNavigator1: TDBNavigator;
    OpenPictureDialog1: TOpenPictureDialog;
    Label4: TLabel;
    RvProject1: TRvProject;
    RvDataSetConnection1: TRvDataSetConnection;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

//procedura obsługuje zdarzenie kliknięcia komponentu TDBImage1
//dodanie dwóch rekordów (tylko pola Nazwisko) na początku
procedure TForm1.Button1Click(Sender: TObject);
begin
 RvProject1.Execute;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Table1.Close;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Table1.TableName:='nowa2.dbf';
  Table1.IndexName:='LP';
  DBGrid1.Columns.Add;
  DBGrid1.Columns[0].Fieldname:='LP';
  DBGrid1.Columns.Add;
  DBGrid1.Columns[1].Fieldname:='NAZWISKO';
  DBGrid1.Columns.Add;
  DBGrid1.Columns[2].Fieldname:='IMIE';
  DBGrid1.Columns.Add;
  DBGrid1.Columns[3].Fieldname:='WIEK';

  DBMemo1.DataField:='UWAGI';
  DBImage1.DataField:='OBRAZ';
  Table1.Active:=true;
  RvProject1.ProjectFile:='druk_bazy.rav';
end;

end.
