.NET Zip component, Delphi Zip component, Barcode .NET, BDE Replacement and other .NET and Delphi components from ComponentAce
Products Download Order Contact us

Search
 

Delphi/C++ Components
.NET Components
ActiveX Controls
Kylix Components

Download

Download
Download Commercial
Trial Limitations

Support

Submit Request
Support Options

Order

Purchase
Competitive Upgrade
Premium Support
Sales Policy
Upgrade Policy
License Types

Info

News
Mailing List
Articles
Testimonials



About Us
Partners
Links
Contact Us
Link to Us





Home > Delphi/C++ Components > Absolute Database > Range Delphi Example

Absolute Database

Overview | Features | Requirements | Testimonials | SQL Samples | Code Samples | Screenshots | See Also | Download | Order
Range Delphi Example
Illustrates setting ranges on records

Download Absolute Database | Learn more

unit uRange;

interface
{$I CompVer.inc}

uses
{$IFDEF D6H}
  Variants,
{$ENDIF}
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids, DBGrids, DB, ABSMain, ComCtrls, ExtCtrls,
  Buttons;

const
  DataBaseFileName: String = '..\..\Data\Demos.abs';
  QueryConst: String = 'select * from employee order by ';

type
  TForm1 = class(TForm)
    dbDemos: TABSDatabase;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    GroupBox1: TGroupBox;
    Label2: TLabel;
    Table: TABSTable;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    Label3: TLabel;
    cmbStartRange: TComboBox;
    cmbEndRange: TComboBox;
    cbStartKeyExclusive: TCheckBox;
    cbEndKeyExclusive: TCheckBox;
    btRange: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure btRangeClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  s:string;
  index:string;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
 dbDemos.DatabaseFileName := ExtractFilePath(Application.ExeName) + DataBaseFileName;
 dbDemos.Open;
 Table.Open;
 Table.IndexName := 'ByVenue';
 Table.First;
 while not Table.Eof do
  begin
   cmbEndRange.Items.Add(Table.FieldByName('Venue').AsString);
   cmbStartRange.Items.Add(Table.FieldByName('Venue').AsString);
   Table.Next;
  end;
   cmbStartRange.ItemIndex := 0;
   cmbEndRange.ItemIndex := 3;
end;

procedure TForm1.btRangeClick(Sender: TObject);
begin
 if btRange.Caption = 'Apply' then
  begin
   Table.IndexName := 'ByVenue';
   Table.SetRangeStart;
   Table.FieldByName('Venue').AsString := cmbStartRange.Text;
   Table.KeyExclusive := cbStartKeyExclusive.Checked;
   Table.SetRangeEnd;
   Table.FieldByName('Venue').AsString := cmbEndRange.Text;
   Table.KeyExclusive := cbEndKeyExclusive.Checked;
   Table.ApplyRange;
   btRange.Kind := bkCancel;
  end
 else
  begin
   Table.CancelRange;
   btRange.Kind := bkOK;
   btRange.Caption := 'Apply';
  end;
end;

end.



Range Delphi Example
Download Absolute Database | Learn more


Product Info


Current version: 7.95
Released: February 08, 2023
Price: $ 149

downloadorder


Our Customers



Testimonials

I don't think I've ever had a better support experience in regard to any of the 3rd party tools we use.

Tim Stickley

        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Dec 03, 2024