Marco's Web Center

Menu for Development

Site Menu
Object Pascal Handbook
Delphi Handbooks Collection
Mastering Borland Delphi 2005
(Old) White Papers
(Old)Tools
(Old) Conferences

My Other Sites
Italian Site (www.marcocantu.it)
the delphi search

Spirit of delphi

Advertising
Home My Blog Books Object Pascal Marco

Home: Code Repository: Mastering Delphi 6

Chapter 15 - Project Ibemp

Project Structure

Ibemp.dpr
program IbEmp;

uses
  Forms,
  IbEmpF in 'IbEmpF.pas' {FormEmp};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TFormEmp, FormEmp);
  Application.Run;
end.
IbEmpF.pas
unit IbEmpF;

interface

uses
  SysUtils, Windows, Messages, Classes, Graphics, Controls,
  StdCtrls, Forms, DBCtrls, DB, DBTables, Mask, ExtCtrls;

type
  TFormEmp = class(TForm)
    DBNavigator: TDBNavigator;
    Panel1: TPanel;
    DataSource1: TDataSource;
    Panel2: TPanel;
    Query1: TQuery;
    ScrollBox: TScrollBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    DBEdit6: TDBEdit;
    DBEdit7: TDBEdit;
    DBEdit8: TDBEdit;
    DBEdit9: TDBEdit;
    DBEdit10: TDBEdit;
    DBEdit11: TDBEdit;
    procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  FormEmp: TFormEmp;

implementation

{$R *.DFM}

procedure TFormEmp.FormCreate(Sender: TObject);
begin
  Query1.Open;
end;

end.
IbEmpF.dfm
object FormEmp: TFormEmp
  Left = 213
  Top = 174
  Width = 465
  Height = 320
  ActiveControl = Panel1
  Caption = 'InterBase Employee'
  Color = clBtnFace
  ParentFont = True
  OldCreateOrder = True
  Position = poScreenCenter
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Panel1: TPanel
    Left = 0
    Top = 0
    Width = 457
    Height = 41
    Align = alTop
    TabOrder = 0
    object DBNavigator: TDBNavigator
      Left = 8
      Top = 8
      Width = 240
      Height = 25
      DataSource = DataSource1
      Flat = True
      Ctl3D = False
      ParentCtl3D = False
      TabOrder = 0
    end
  end
  object Panel2: TPanel
    Left = 0
    Top = 41
    Width = 457
    Height = 252
    Align = alClient
    BevelInner = bvLowered
    BorderWidth = 4
    Caption = 'Panel2'
    TabOrder = 1
    object ScrollBox: TScrollBox
      Left = 6
      Top = 6
      Width = 445
      Height = 240
      HorzScrollBar.Margin = 6
      HorzScrollBar.Range = 132
      VertScrollBar.Margin = 6
      VertScrollBar.Range = 236
      Align = alClient
      AutoScroll = False
      BorderStyle = bsNone
      TabOrder = 0
      object Label1: TLabel
        Left = 40
        Top = 24
        Width = 45
        Height = 13
        Caption = 'EMP_NO'
        FocusControl = DBEdit1
      end
      object Label2: TLabel
        Left = 40
        Top = 64
        Width = 68
        Height = 13
        Caption = 'FIRST_NAME'
        FocusControl = DBEdit2
      end
      object Label3: TLabel
        Left = 40
        Top = 104
        Width = 64
        Height = 13
        Caption = 'LAST_NAME'
        FocusControl = DBEdit3
      end
      object Label4: TLabel
        Left = 40
        Top = 144
        Width = 65
        Height = 13
        Caption = 'PHONE_EXT'
        FocusControl = DBEdit4
      end
      object Label5: TLabel
        Left = 40
        Top = 184
        Width = 61
        Height = 13
        Caption = 'HIRE_DATE'
        FocusControl = DBEdit5
      end
      object Label6: TLabel
        Left = 336
        Top = 24
        Width = 51
        Height = 13
        Caption = 'DEPT_NO'
        FocusControl = DBEdit6
      end
      object Label7: TLabel
        Left = 200
        Top = 24
        Width = 56
        Height = 13
        Caption = 'JOB_CODE'
        FocusControl = DBEdit7
      end
      object Label8: TLabel
        Left = 200
        Top = 64
        Width = 64
        Height = 13
        Caption = 'JOB_GRADE'
        FocusControl = DBEdit8
      end
      object Label9: TLabel
        Left = 200
        Top = 104
        Width = 79
        Height = 13
        Caption = 'JOB_COUNTRY'
        FocusControl = DBEdit9
      end
      object Label10: TLabel
        Left = 200
        Top = 144
        Width = 42
        Height = 13
        Caption = 'SALARY'
        FocusControl = DBEdit10
      end
      object Label11: TLabel
        Left = 200
        Top = 184
        Width = 63
        Height = 13
        Caption = 'FULL_NAME'
        FocusControl = DBEdit11
      end
      object DBEdit1: TDBEdit
        Left = 40
        Top = 40
        Width = 64
        Height = 21
        DataField = 'EMP_NO'
        DataSource = DataSource1
        TabOrder = 0
      end
      object DBEdit2: TDBEdit
        Left = 40
        Top = 80
        Width = 94
        Height = 21
        DataField = 'FIRST_NAME'
        DataSource = DataSource1
        TabOrder = 1
      end
      object DBEdit3: TDBEdit
        Left = 40
        Top = 120
        Width = 124
        Height = 21
        DataField = 'LAST_NAME'
        DataSource = DataSource1
        TabOrder = 2
      end
      object DBEdit4: TDBEdit
        Left = 40
        Top = 160
        Width = 28
        Height = 21
        DataField = 'PHONE_EXT'
        DataSource = DataSource1
        TabOrder = 3
      end
      object DBEdit5: TDBEdit
        Left = 40
        Top = 200
        Width = 112
        Height = 21
        DataField = 'HIRE_DATE'
        DataSource = DataSource1
        TabOrder = 4
      end
      object DBEdit6: TDBEdit
        Left = 336
        Top = 40
        Width = 49
        Height = 21
        DataField = 'DEPT_NO'
        DataSource = DataSource1
        TabOrder = 5
      end
      object DBEdit7: TDBEdit
        Left = 200
        Top = 40
        Width = 34
        Height = 21
        DataField = 'JOB_CODE'
        DataSource = DataSource1
        TabOrder = 6
      end
      object DBEdit8: TDBEdit
        Left = 200
        Top = 80
        Width = 64
        Height = 21
        DataField = 'JOB_GRADE'
        DataSource = DataSource1
        TabOrder = 7
      end
      object DBEdit9: TDBEdit
        Left = 200
        Top = 120
        Width = 94
        Height = 21
        DataField = 'JOB_COUNTRY'
        DataSource = DataSource1
        TabOrder = 8
      end
      object DBEdit10: TDBEdit
        Left = 200
        Top = 160
        Width = 64
        Height = 21
        DataField = 'SALARY'
        DataSource = DataSource1
        TabOrder = 9
      end
      object DBEdit11: TDBEdit
        Left = 200
        Top = 200
        Width = 226
        Height = 21
        DataField = 'FULL_NAME'
        DataSource = DataSource1
        TabOrder = 10
      end
    end
  end
  object Query1: TQuery
    DatabaseName = 'IBLocal'
    RequestLive = True
    SQL.Strings = (
      'SELECT * '
      'FROM EMPLOYEE')
    Left = 147
    Top = 69
  end
  object DataSource1: TDataSource
    DataSet = Query1
    Left = 143
    Top = 117
  end
end