.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 > Client Dataset Delphi Example

Absolute Database

Overview | Features | Requirements | Testimonials | SQL Samples | Code Samples | Screenshots | See Also | Download | Order
Client Dataset Delphi Example
Illustrates how to work with ClientDataset using IProvider interface.

Download Absolute Database | Learn more

unit Main;

interface
{$I CompVer.inc}

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

const
  DataBaseFileName: String = '..\..\Data\Demos.abs';

type
  TForm1 = class(TForm)
    DBGrid1: TDBGrid;
    dbDemos: TABSDatabase;
    ABSTable: TABSTable;
    ABSQuery: TABSQuery;
    DataSource: TDataSource;
    DataSetProvider: TDataSetProvider;
    ClientDataSet: TClientDataSet;
    rgDataSet: TRadioGroup;
    btnReOpen: TButton;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    eUpdateSql: TEdit;
    Button2: TButton;
    Button1: TButton;
    DataSetProviderUpdate: TDataSetProvider;
    ClientDataSetUpdate: TClientDataSet;
    ABSQueryUpdate: TABSQuery;
    DBNavigator1: TDBNavigator;
    Label2: TLabel;
    Label1: TLabel;
    Label3: TLabel;
    procedure btnReOpenClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ApplyUpdates(DataSet: TDataSet);
  private
    { Private declarations }
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  dbDemos.DatabaseFileName := ExtractFilePath(Application.ExeName) + DataBaseFileName;
  ClientDataSet.Open;
end;

procedure TForm1.btnReOpenClick(Sender: TObject);
begin
  ClientDataSet.Close;
  if rgDataSet.ItemIndex = 1 then
    DataSetProvider.DataSet := ABSTable
  else
    DataSetProvider.DataSet := ABSQuery;
  ClientDataSet.Open;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ClientDataSet.Close;
end;

procedure TForm1.ApplyUpdates(DataSet: TDataSet);
begin
 ClientDataSet.ApplyUpdates(0);
end;


procedure TForm1.Button2Click(Sender: TObject);
begin
{$IFDEF D5H}
  ClientDataSetUpdate.CommandText := eUpdateSql.Text;
  ClientDataSetUpdate.Execute;
  ClientDataSet.Open;
  ClientDataSet.Refresh;
{$ELSE}
  MessageDlg('Supported in Delphi 5 and higher only', mtInformation, [mbOK], 0);
{$ENDIF}
end;

end.



Client Dataset Delphi Example
Download Absolute Database | Learn more


Product Info


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

downloadorder


Our Customers



Testimonials

Component Ace is all that it advertises. It is easy to implement and is very fast.

In addition, the customer support is the best I have ever had. All my questions were answered within hours, often immediately. The responses also answered my questions, no need for followup emails.

If your application needs the functionality that Component Ace provides, search no further.

Linda Murphy

        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Oct 07, 2024