Batch Move Delphi Example
Batch Move Delphi Example
recent searches
Home > Delphi/C++ Components > Absolute Database > Batch Move Delphi Example
Delphi/C++ Components
.NET Components Absolute Database
Overview | Features | Requirements | Testimonials | SQL Samples | Code Samples | Screenshots | See Also | Download | Order
ActiveX Controls
Kylix Components Batch Move Delphi Example
Shows how to move / update / synchronize records between two tables.
uses
Submit Request {$IFDEF D6H}
Variants,
Support Options {$ENDIF}
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, DB, ABSMain, StdCtrls, Grids, DBGrids, ExtCtrls, DBTables,
ComCtrls;
Purchase
type
Competitive Upgrade TForm1 = class(TForm)
tSrc: TABSTable;
Premium Support
tDst: TABSTable;
Sales Policy DBGrid1: TDBGrid;
Upgrade Policy
DBGrid2: TDBGrid;
Button1: TButton;
License Types Label2: TLabel;
Label3: TLabel;
Button2: TButton;
dsSrc: TDataSource;
dsDst: TDataSource;
News rgType: TRadioGroup;
Mailing List pb: TProgressBar;
GroupBox1: TGroupBox;
Articles Label1: TLabel;
Testimonials procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure tDstBeforeBatchMove(Sender: TObject);
procedure tDstAfterBatchMove(Sender: TObject);
About Us procedure tDstBatchMoveProgress(Sender: TObject; PercentDone: Integer;
Partners var Continue: Boolean);
private
Links { Private declarations }
Contact Us public
{ Public declarations }
Link to Us procedure InitTables;
end;
var
Form1: TForm1;
implementation
uses ABSTypes;
{$R *.dfm}
procedure TForm1.InitTables;
begin
with tSrc do
begin
Close;
FieldDefs.Clear;
FieldDefs.Add('id', ftAutoInc, 0, False);
FieldDefs.Add('name', ftString, 10, False);
FieldDefs.Add('code', ftInteger, 0, False);
FieldDefs.Add('address', ftString, 10, False);
IndexDefs.Clear;
IndexDefs.Add('pk_code','code',[ixPrimary]);
CreateTable;
Open;
Insert;
FieldByName('name').AsString := 'Johnny';
FieldByName('code').AsInteger := 10;
FieldByName('address').AsString := 'USA';
Post;
Insert;
FieldByName('name').AsString := 'Piter';
FieldByName('code').AsInteger := 12;
FieldByName('address').AsString := 'Germany';
Post;
end;
with tDst do
begin
Close;
FieldDefs.Clear;
FieldDefs.Add('code', ftInteger, 0, False);
FieldDefs.Add('name', ftString, 10, False);
FieldDefs.Add('lastname', ftString, 10, False);
IndexDefs.Clear;
IndexDefs.Add('pk_code','code',[ixPrimary]);
CreateTable;
Open;
Insert;
FieldByName('code').AsInteger := 10;
FieldByName('name').AsString := 'John';
FieldByName('lastname').AsString := 'Smith';
Post;
Insert;
FieldByName('code').AsInteger := 11;
FieldByName('name').AsString := 'Andrew';
FieldByName('lastname').AsString := 'Harrison';
Post;
end;
pb.Position := 0;
end;
end.
Download Absolute Database | Learn more
© 2003 - 2020 ComponentAce | .net zip component | barcode for .net | delphi zip component | delphi database May 19, 2020