Logo New book: Delphi 2007 Handbook
My blog in online
Delphi tech support service: support.marcocantu.com
Google
  Web www.marcocantu.com

Menu for Development

Site Menu
Delphi 2007 Handbook
Mastering Borland Delphi 2005
Essential Pascal
Essential Delphi
Buy Books Online
Code Repository
Newsgroups
White Papers
Tools
Conferences
Training
Delphi Links
Contact Marco

My Other Sites
Italian Site (www.marcocantu.it)
Developers Newsgroups Browser (dev.newswhat.com)
My town (www.piazzacavalli.net)
the delphi search
Wintech Italia (my company)

Breaking News
Buy Mastering Borland Delphi 2005 from Amazon
Free ebook: Mastering Delphi Update for Delphi 2006

Advertising
Home My Blog Books My Bookstore Development Links Marco



Home: Code Repository: Mastering Delphi 5

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)
    ScrollBox: TScrollBox;
    Label1: TLabel;
    EditEMPNO: TDBEdit;
    Label2: TLabel;
    EditLASTNAME: TDBEdit;
    Label3: TLabel;
    EditFIRSTNAME: TDBEdit;
    Label4: TLabel;
    EditPHONEEXT: TDBEdit;
    Label5: TLabel;
    EditHIREDATE: TDBEdit;
    Label6: TLabel;
    EditSALARY: TDBEdit;
    DBNavigator: TDBNavigator;
    Panel1: TPanel;
    DataSource1: TDataSource;
    Panel2: TPanel;
    Query1: TQuery;
    Query1EMPNO: TIntegerField;
    Query1FIRSTNAME: TStringField;
    Query1LASTNAME: TStringField;
    Query1PHONEEXT: TStringField;
    Query1HIREDATE: TDateTimeField;
    Query1SALARY: TFloatField;
    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 = 288
  Height = 218
  ActiveControl = Panel1
  Caption = 'InterBase Employee'
  ParentFont = True
  Position = poScreenCenter
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Panel1: TPanel
    Left = 0
    Top = 0
    Width = 280
    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 = 280
    Height = 150
    Align = alClient
    BevelInner = bvLowered
    BorderWidth = 4
    Caption = 'Panel2'
    TabOrder = 1
    object ScrollBox: TScrollBox
      Left = 6
      Top = 6
      Width = 268
      Height = 138
      HorzScrollBar.Margin = 6
      HorzScrollBar.Range = 132
      VertScrollBar.Margin = 6
      VertScrollBar.Range = 236
      Align = alClient
      AutoScroll = False
      BorderStyle = bsNone
      TabOrder = 0
      object Label1: TLabel
        Left = 174
        Top = 4
        Width = 39
        Height = 13
        Caption = 'EMPNO'
        FocusControl = EditEMPNO
      end
      object Label2: TLabel
        Left = 6
        Top = 4
        Width = 58
        Height = 13
        Caption = 'LASTNAME'
        FocusControl = EditLASTNAME
      end
      object Label3: TLabel
        Left = 6
        Top = 42
        Width = 62
        Height = 13
        Caption = 'FIRSTNAME'
        FocusControl = EditFIRSTNAME
      end
      object Label4: TLabel
        Left = 174
        Top = 42
        Width = 59
        Height = 13
        Caption = 'PHONEEXT'
        FocusControl = EditPHONEEXT
      end
      object Label5: TLabel
        Left = 6
        Top = 86
        Width = 55
        Height = 13
        Caption = 'HIREDATE'
        FocusControl = EditHIREDATE
      end
      object Label6: TLabel
        Left = 174
        Top = 86
        Width = 42
        Height = 13
        Caption = 'SALARY'
        FocusControl = EditSALARY
      end
      object EditEMPNO: TDBEdit
        Left = 174
        Top = 19
        Width = 55
        Height = 21
        DataField = 'EMPNO'
        DataSource = DataSource1
        TabOrder = 0
      end
      object EditLASTNAME: TDBEdit
        Left = 6
        Top = 19
        Width = 115
        Height = 21
        DataField = 'LASTNAME'
        DataSource = DataSource1
        TabOrder = 1
      end
      object EditFIRSTNAME: TDBEdit
        Left = 6
        Top = 57
        Width = 90
        Height = 21
        DataField = 'FIRSTNAME'
        DataSource = DataSource1
        TabOrder = 2
      end
      object EditPHONEEXT: TDBEdit
        Left = 174
        Top = 57
        Width = 35
        Height = 21
        DataField = 'PHONEEXT'
        DataSource = DataSource1
        TabOrder = 3
      end
      object EditHIREDATE: TDBEdit
        Left = 6
        Top = 101
        Width = 120
        Height = 21
        DataField = 'HIREDATE'
        DataSource = DataSource1
        TabOrder = 4
      end
      object EditSALARY: TDBEdit
        Left = 174
        Top = 101
        Width = 65
        Height = 21
        DataField = 'SALARY'
        DataSource = DataSource1
        TabOrder = 5
      end
    end
  end
  object Query1: TQuery
    DatabaseName = 'IBLOCAL'
    RequestLive = True
    SQL.Strings = (
      'SELECT EMPLOYEE.EMPNO , EMPLOYEE.FIRSTNAME , '
      ' EMPLOYEE.LASTNAME , '
      ' EMPLOYEE.PHONEEXT , '
      ' EMPLOYEE.HIREDATE , EMPLOYEE.SALARY'
      'FROM EMPLOYEE EMPLOYEE')
    Left = 147
    Top = 69
    object Query1EMPNO: TIntegerField
      FieldName = 'EMPNO'
      Origin = 'EMPLOYEE.EMPNO'
    end
    object Query1FIRSTNAME: TStringField
      FieldName = 'FIRSTNAME'
      Origin = 'EMPLOYEE.FIRSTNAME'
      Size = 15
    end
    object Query1LASTNAME: TStringField
      FieldName = 'LASTNAME'
      Origin = 'EMPLOYEE.LASTNAME'
    end
    object Query1PHONEEXT: TStringField
      FieldName = 'PHONEEXT'
      Origin = 'EMPLOYEE.PHONEEXT'
      Size = 4
    end
    object Query1HIREDATE: TDateTimeField
      FieldName = 'HIREDATE'
      Origin = 'EMPLOYEE.HIREDATE'
    end
    object Query1SALARY: TFloatField
      FieldName = 'SALARY'
      Origin = 'EMPLOYEE.SALARY'
    end
  end
  object DataSource1: TDataSource
    DataSet = Query1
    Left = 143
    Top = 117
  end
end