unit ufrmFIBPlusdynamischDemo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,
DB, FIBDataSet, pFIBDataSet, FIBDatabase, pFIBDatabase, Grids,
DBGrids, StdCtrls, ExtCtrls, FIBQuery, pFIBQuery, DBCtrls, pFIBProps;
type
TfrmFIBPlusDemo =
class(TForm)
DataSource1: TDataSource;
DBNavigator1: TDBNavigator;
Button1: TButton;
DBGrid1: TDBGrid;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
pFIBDataBase1: TpFIBDataBase;
pFIBDataSet1: TpFIBDataSet;
pFIBTransaction1: TpFIBTransaction;
end;
var
frmFIBPlusDemo: TfrmFIBPlusDemo;
implementation
{$R *.dfm}
procedure TfrmFIBPlusDemo.Button1Click(Sender: TObject);
begin
pFIBDataSet1.Close;
pFIBDataSet1.SelectSQL.Text:= Memo1.Text;
pFIBDataSet1.GenerateSQLs;
pFIBDataSet1.Open;
end;
procedure TfrmFIBPlusDemo.FormCreate(Sender: TObject);
begin
pFIBDataBase1:= TpFIBDataBase.Create(self);
pFIBTransaction1:= TpFIBTransaction.Create(self);
pFIBDataSet1:= TpFIBDataSet.Create(self);
pFIBDataBase1.
Name:= '
pFIBDataBase1';
pFIBDataBase1.ConnectParams.UserName:= '
SYSDBA';
pFIBDataBase1.ConnectParams.Password:= '
masterkey';
pFIBDataBase1.DBName:= '
D:\Eigene Dateien von Internet\'+
'
Borland Studio-Projekte\FirebirdDatenbanken\FB2_0Datenbank\'+
'
examples\empbuild\EMPLOYEE.FDB';
pFIBDataBase1.LibraryName:='
C:\Programme\Firebird\Firebird_2_0\bin\fbclient.dll';
pFIBDataBase1.DefaultTransaction:= pFIBTransaction1;
pFIBDataBase1.DefaultUpdateTransaction:= pFIBTransaction1;
pFIBDataBase1.Connected:= TRUE;
pFIBDataSet1.
Name:= '
pFIBDataSet1';
pFIBDataSet1.Database:=pFIBDataBase1;
pFIBDataSet1.Transaction:= pFIBTransaction1;
pFIBDataSet1.AutoCommit:= TRUE;
pFIBDataSet1.AutoUpdateOptions.UpdateTableName:= '
CUSTOMER';
pFIBDataSet1.AutoUpdateOptions.AutoReWriteSqls:= TRUE;
pFIBTransaction1.
Name:= '
pFIBTransaction1';
pFIBTransaction1.TPBMode:= tpbDefault;
pFIBTransaction1.TimeoutAction:= TACommit;
pFIBTransaction1.Active:= TRUE;
DataSource1.DataSet:= pFIBDataSet1;
end;
procedure TfrmFIBPlusDemo.FormDestroy(Sender: TObject);
begin
freeandNil(pFIBDataSet1);
freeandNil(pFIBTransaction1);
freeandNil(pFIBDataBase1);
end;
end.