home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bde / sdktab.pak / SHOWNEW.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-07-24  |  1.0 KB  |  46 lines

  1. { unit shownew.pas }
  2. unit Shownew;
  3.  
  4. interface
  5.  
  6. uses
  7.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  8.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Grids, DBGrids, DB,
  9.   DBTables, TableEnh;
  10.  
  11. type
  12.   TViewNew = class(TForm)
  13.     Label1: TLabel;
  14.     Panel1: TPanel;
  15.     BitBtn1: TBitBtn;
  16.     DataSource1: TDataSource;
  17.     DBGrid1: TDBGrid;
  18.     DeleteCopy: TCheckBox;
  19.     CountLabel: TLabel;
  20.     TableEnhanced1: TTableEnhanced;
  21.     procedure DataSource1DataChange(Sender: TObject; Field: TField);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   ViewNew: TViewNew;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. { METHOD: DataSource1DataChange
  36.   PURPOSE: When the data changes, update the record count.
  37. }
  38. procedure TViewNew.DataSource1DataChange(Sender: TObject; Field: TField);
  39. begin
  40.   { Display the record count of the copied table }
  41.   CountLabel.Caption := Format('Record count = %d',
  42.                                [TableEnhanced1.RecordCount]);
  43. end;
  44.  
  45. end.
  46.