ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/client/FBAttachment.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/FBAttachment.pas (file contents):
Revision 233 by tony, Mon Apr 16 09:24:40 2018 UTC vs.
Revision 263 by tony, Thu Dec 6 15:55:01 2018 UTC

# Line 38 | Line 38 | unit FBAttachment;
38   interface
39  
40   uses
41 <  Classes, SysUtils, {$IFDEF WINDOWS} windows, {$ENDIF} IB,  FBParamBlock, FBActivityMonitor;
41 >  Classes, SysUtils, {$IFDEF WINDOWS} windows, {$ENDIF} IB,  FBParamBlock,
42 >  FBActivityMonitor, FBClientAPI;
43  
44   type
45    TCharsetMap = record
# Line 68 | Line 69 | type
69      FCodePage: TSystemCodePage;
70      FRemoteProtocol: AnsiString;
71      FAuthMethod: AnsiString;
72 <    constructor Create(DatabaseName: AnsiString; DPB: IDPB;
72 >    constructor Create(api: TFBClientAPI; DatabaseName: AnsiString; DPB: IDPB;
73        RaiseExceptionOnConnectError: boolean);
74      procedure CheckHandle; virtual; abstract;
75      function GenerateCreateDatabaseSQL(DatabaseName: AnsiString; aDPB: IDPB): AnsiString;
# Line 80 | Line 81 | type
81      procedure SetParameters(SQLParams: ISQLParams; params: array of const);
82    public
83      destructor Destroy; override;
84 +    function getFirebirdAPI: IFirebirdAPI;
85      function getDPB: IDPB;
86      function AllocateBPB: IBPB;
87      function AllocateDIRB: IDIRB;
# Line 298 | Line 300 | begin
300    FHasDefaultCharSet := CharSetID2CodePage(FCharSetID,FCodePage) and (FCharSetID > 1);
301   end;
302  
303 < constructor TFBAttachment.Create(DatabaseName: AnsiString; DPB: IDPB;
304 <  RaiseExceptionOnConnectError: boolean);
303 > constructor TFBAttachment.Create(api: TFBClientAPI; DatabaseName: AnsiString;
304 >  DPB: IDPB; RaiseExceptionOnConnectError: boolean);
305   begin
306    inherited Create;
307 <  FFirebirdAPI := FirebirdAPI; {Keep reference to interface}
307 >  FFirebirdAPI := api.GetAPI; {Keep reference to interface}
308    FSQLDialect := 3;
309    FDatabaseName := DatabaseName;
310    FDPB := DPB;
# Line 449 | Line 451 | begin
451    inherited Destroy;
452   end;
453  
454 + function TFBAttachment.getFirebirdAPI: IFirebirdAPI;
455 + begin
456 +  Result := FFirebirdAPI;
457 + end;
458 +
459   function TFBAttachment.getDPB: IDPB;
460   begin
461    Result := FDPB;
# Line 456 | Line 463 | end;
463  
464   function TFBAttachment.AllocateBPB: IBPB;
465   begin
466 <  Result := TBPB.Create;
466 >  Result := TBPB.Create(FFirebirdAPI as TFBClientAPI);
467   end;
468  
469   function TFBAttachment.AllocateDIRB: IDIRB;
470   begin
471 <  Result := TDIRB.Create;
471 >  Result := TDIRB.Create(FFirebirdAPI as TFBClientAPI);
472   end;
473  
474   procedure TFBAttachment.ExecImmediate(TPB: array of byte; sql: AnsiString;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines