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 5

Project MULTI1

Project Structure


MULTI1.DPR

program Multi1;

uses
  Forms,
  MultiRec in 'MultiRec.pas' {Form1};

{$R *.RES}

begin
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

MULTIREC.PAS

unit MultiRec;

interface

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

type
  TForm1 = class(TForm)
    DBCtrlGrid1: TDBCtrlGrid;
    Table1: TTable;
    DataSource1: TDataSource;
    Table1Name: TStringField;
    Table1Capital: TStringField;
    Table1Continent: TStringField;
    Table1Area: TFloatField;
    Table1Population: TFloatField;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    Label1: TLabel;
    Label2: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

end.

MULTIREC.DFM

object Form1: TForm1
  Left = 263
  Top = 199
  BorderStyle = bsSingle
  Caption = 'Multi Record Grid'
  ClientHeight = 208
  ClientWidth = 330
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  PixelsPerInch = 96
  TextHeight = 13
  object DBCtrlGrid1: TDBCtrlGrid
    Left = 0
    Top = 0
    Width = 332
    Height = 208
    ColCount = 2
    DataSource = DataSource1
    PanelHeight = 104
    PanelWidth = 158
    TabOrder = 0
    RowCount = 2
    object Label1: TLabel
      Left = 8
      Top = 9
      Width = 39
      Height = 13
      Caption = 'Country:'
    end
    object Label2: TLabel
      Left = 8
      Top = 52
      Width = 35
      Height = 13
      Caption = 'Capital:'
    end
    object DBEdit1: TDBEdit
      Left = 8
      Top = 25
      Width = 137
      Height = 21
      DataField = 'Name'
      DataSource = DataSource1
      MaxLength = 24
      TabOrder = 0
    end
    object DBEdit2: TDBEdit
      Left = 8
      Top = 68
      Width = 137
      Height = 21
      DataField = 'Capital'
      DataSource = DataSource1
      MaxLength = 24
      TabOrder = 1
    end
  end
  object Table1: TTable
    Active = True
    DatabaseName = 'DBDEMOS'
    TableName = 'COUNTRY.DB'
    Left = 16
    Top = 152
    object Table1Name: TStringField
      FieldName = 'Name'
      Size = 24
    end
    object Table1Capital: TStringField
      FieldName = 'Capital'
      Size = 24
    end
    object Table1Continent: TStringField
      FieldName = 'Continent'
      Size = 24
    end
    object Table1Area: TFloatField
      FieldName = 'Area'
    end
    object Table1Population: TFloatField
      FieldName = 'Population'
    end
  end
  object DataSource1: TDataSource
    DataSet = Table1
    Left = 72
    Top = 152
  end
end