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

Comparing ibx/trunk/fbintf/IB.pas (file contents):
Revision 47 by tony, Mon Jan 9 15:31:51 2017 UTC vs.
Revision 308 by tony, Sat Jul 18 10:26:30 2020 UTC

# Line 60 | Line 60
60   {                                                                        }
61   {************************************************************************}
62   unit IB;
63 + {$IFDEF MSWINDOWS}
64 + {$DEFINE WINDOWS}
65 + {$ENDIF}
66  
67   {$IFDEF FPC}
68 < {$mode objfpc}{$H+}
68 > {$mode delphi}
69   {$codepage UTF8}
70   {$interfaces COM}
71 < {$IF FPC_FULLVERSION < 30000 }
71 > {$IF defined(FPC) and (FPC_FULLVERSION < 30000) }
72   {$ERROR FPC Version 3.0.0 or later is required}
73 < {$ENDIF}
73 > {$IFEND}
74   {$ENDIF}
75  
76 + {$IFNDEF LEGACYFIREBIRDAPIONLY}
77   {$DEFINE USEFIREBIRD3API}
78 + {$ENDIF}
79 + {$IFNDEF FIREBIRD3APIONLY}
80   {$DEFINE USELEGACYFIREBIRDAPI}
81 + {$ENDIF}
82  
83   {
84    This unit defines the interfaces used to provide the Pascal Language
# Line 103 | Line 110 | unit IB;
110  
111    5. Straightforward progammatic access to the Firebird API from Pascal programs.
112  
113 +  6. FPC and Delphi Support.
114 +
115    String Types
116    ============
117  
# Line 117 | Line 126 | unit IB;
126   interface
127  
128   uses
129 <  Classes, SysUtils, DB, FBMessages, IBExternals;
129 >  Classes,
130 >  {$IFDEF WINDOWS}Windows, {$ENDIF}
131 >  {$IFDEF FPC} Dynlibs, {$ENDIF}
132 >  SysUtils, DB, FBMessages, IBExternals;
133  
134   const
135    {Interface version information}
136    FBIntf_Major = 1;
137 <  FBIntf_Minor = 0;
138 <  FBIntf_Release = 1;
139 <  FBIntf_Version = '1.0.1';
137 >  FBIntf_Minor = 1;
138 >  FBIntf_Release = 6;
139 >  FBIntf_Version = '1.1.6';
140  
141   {These include files are converted from the 'C' originals in the Firebird API
142   and define the various constants used by the API}
143  
144 < {$I consts_pub.inc}
145 < {$I inf_pub.inc}
146 < {$I configkeys.inc}
144 > {$I 'include/consts_pub.inc'}
145 > {$I 'include/inf_pub.inc'}
146 > {$I 'include/configkeys.inc'}
147  
148   {The following constants define the values return by calls to the GetSQLType
149   methods provided by several of the interfaces defined below.}
# Line 167 | Line 179 | type
179     PGDS__QUAD           = ^TGDS__QUAD;
180     PISC_QUAD            = ^TISC_QUAD;
181  
182 + {$IFNDEF FPC}
183 + {Delphi missing definitions}
184 + type
185 +  TLibHandle = THandle;
186 +
187 + const
188 +  NilHandle = 0;
189 +  DirectorySeparator = '\';
190 +
191 + {Delphi only seems to define CP_UTF8 and CP_UTF16}
192 + const
193 +  CP_ACP     = 0;     // default to ANSI code page
194 +  CP_OEMCP   = 1;     // default to OEM (console) code page
195 +  CP_UTF16BE = 1201;  // unicodeFFFE
196 +  CP_UTF7    = 65000; // utf-7
197 +  CP_ASCII   = 20127; // us-ascii
198 +  CP_NONE    = $FFFF; // rawbytestring encoding
199 +
200 + {$ENDIF}
201 +
202 + type
203 + {$IF not declared(TSystemCodePage)}
204 +  TSystemCodePage = word; {not defined in Delphi}
205 + {$IFEND}
206 +
207    TIBSQLStatementTypes =
208                   (SQLUnknown, SQLSelect, SQLInsert,
209                    SQLUpdate, SQLDelete, SQLDDL,
210                    SQLGetSegment, SQLPutSegment,
211                    SQLExecProcedure, SQLStartTransaction,
212                    SQLCommit, SQLRollback,
213 <                  SQLSelectForUpdate, SQLSetGenerator);
213 >                  SQLSelectForUpdate, SQLSetGenerator,
214 >                  SQLSavePoint);
215  
216    TFBStatusCode = cardinal;
217    TByteArray = array of byte;
218  
219 +  IFirebirdAPI = interface;
220    IAttachment = interface;
221    ITransaction = interface;
222 +  IStatement = interface;
223  
224 <  {The IParameterBlock generic interface provides the template for all parameter
224 >  {The IParameterBlock interface provides the template for all parameter
225     block interfaces}
226  
227 <  generic IParameterBlock<_IItem> = interface
227 >  IParameterBlock<_IItem> = interface
228      function getCount: integer;
229      function Add(ParamType: byte): _IItem;
230      function getItems(index: integer): _IItem;
# Line 198 | Line 238 | type
238     different parameter block items }
239  
240    IParameterBlockItem = interface
241 +    ['{53b23f7b-abda-46a5-9aa5-07bd5e723266}']
242      function getParamType: byte;
243      function getAsInteger: integer;
244 <    function getAsString: string;
244 >    function getAsString: AnsiString;
245      function getAsByte: byte;
246 <    procedure setAsString(aValue: string);
246 >    procedure setAsString(aValue: AnsiString);
247      procedure setAsByte(aValue: byte);
248      procedure SetAsInteger(aValue: integer);
249 <    property AsString: string read getAsString write setAsString;
249 >    property AsString: AnsiString read getAsString write setAsString;
250      property AsByte: byte read getAsByte write setAsByte;
251      property AsInteger: integer read getAsInteger write SetAsInteger;
252    end;
# Line 218 | Line 259 | type
259     This interface can be accessed from IFirebirdAPI.
260     }
261  
262 +   TIBDataBaseErrorMessage    = (ShowSQLCode,
263 +                                   ShowIBMessage,
264 +                                   ShowSQLMessage);
265 +
266 +   TIBDataBaseErrorMessages   = set of TIBDataBaseErrorMessage;
267 +
268    IStatus = interface
269 +    ['{34167722-af38-4831-b08a-93162d58ede3}']
270      function GetIBErrorCode: Long;
271      function Getsqlcode: Long;
272 <    function GetMessage: string;
272 >    function GetMessage: AnsiString;
273      function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean;
274      function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages;
275      procedure SetIBDataBaseErrorMessages(Value: TIBDataBaseErrorMessages);
# Line 238 | Line 286 | type
286    TArrayBounds = array of TArrayBound;
287  
288    IArrayMetaData = interface
289 +    ['{7dd0aea4-59af-4c2a-b958-565d5025c489}']
290      function GetSQLType: cardinal;
291 <    function GetSQLTypeName: string;
291 >    function GetSQLTypeName: AnsiString;
292      function GetScale: integer;
293      function GetSize: cardinal;
294      function GetCharSetID: cardinal;
295 <    function GetTableName: string;
296 <    function GetColumnName: string;
295 >    function GetTableName: AnsiString;
296 >    function GetColumnName: AnsiString;
297      function GetDimensions: integer;
298      function GetBounds: TArrayBounds;
299    end;
# Line 269 | Line 318 | type
318    TArrayEventHandler = procedure(Sender: IArray; Reason: TArrayEventReason) of object;
319  
320    IArray = interface(IArrayMetaData)
321 +    ['{631c6bb1-fb49-44fb-a64a-c49859632b88}']
322      function GetArrayID: TISC_QUAD;
323      procedure Clear;
324      function IsEmpty: boolean;
# Line 284 | Line 334 | type
334      function GetAsFloat(index: array of integer): Float;
335      function GetAsLong(index: array of integer): Long;
336      function GetAsShort(index: array of integer): Short;
337 <    function GetAsString(index: array of integer): String;
337 >    function GetAsString(index: array of integer): AnsiString;
338      function GetAsVariant(index: array of integer): Variant;
339      procedure SetAsInteger(index: array of integer; AValue: integer);
340      procedure SetAsBoolean(index: array of integer; AValue: boolean);
# Line 297 | Line 347 | type
347      procedure SetAsDouble(index: array of integer; Value: Double);
348      procedure SetAsFloat(index: array of integer; Value: Float);
349      procedure SetAsShort(index: array of integer; Value: Short);
350 <    procedure SetAsString(index: array of integer; Value: String);
350 >    procedure SetAsString(index: array of integer; Value: AnsiString);
351      procedure SetAsVariant(index: array of integer; Value: Variant);
352      procedure SetBounds(dim, UpperBound, LowerBound: integer);
353      function GetAttachment: IAttachment;
# Line 311 | Line 361 | type
361    }
362  
363    IBlobMetaData = interface
364 +    ['{575f3c61-bb33-46a5-8975-bb7d1b6e37cc}']
365      function GetSubType: integer;
366      function GetCharSetID: cardinal;
367      function GetCodePage: TSystemCodePage;
368      function GetSegmentSize: cardinal;
369 <    function GetRelationName: string;
370 <    function GetColumnName: string;
369 >    function GetRelationName: AnsiString;
370 >    function GetColumnName: AnsiString;
371    end;
372  
373    {The Blob Parameter block is used to select a Blob Filter}
374  
375 <  IBPBItem = interface (IParameterBlockItem) end;
375 >  IBPBItem = interface (IParameterBlockItem)
376 >    ['{660822a5-3114-4c16-b6cb-c1a7b2aba70d}']
377 >  end;
378  
379 <  IBPB = specialize IParameterBlock<IBPBItem>;
379 >  IBPB = interface (IParameterBlock<IBPBItem>)
380 >    ['{e0cb9eb5-17f7-4416-b7d1-3cddd1dfca76}']
381 >  end;
382  
383    { The Blob Interface provides access to a blob data item.
384  
# Line 337 | Line 392 | type
392    TBlobType = (btSegmented,btStream);
393  
394    IBlob = interface(IBlobMetaData)
395 +    ['{3090a145-7780-442b-b15b-efd4568b8611}']
396      function GetBPB: IBPB;
397      procedure Cancel;
398      procedure Close;
# Line 347 | Line 403 | type
403                        TotalSize: Int64; var BlobType: TBlobType);
404      function Read(var Buffer; Count: Longint): Longint;
405      function Write(const Buffer; Count: Longint): Longint;
406 <    function LoadFromFile(Filename: string): IBlob;
406 >    function LoadFromFile(Filename: AnsiString): IBlob;
407      function LoadFromStream(S: TStream) : IBlob;
408 <    function SaveToFile(Filename: string): IBlob;
408 >    function SaveToFile(Filename: AnsiString): IBlob;
409      function SaveToStream(S: TStream): IBlob;
410      function GetAsString: rawbytestring;
411      procedure SetAsString(aValue: rawbytestring);
# Line 363 | Line 419 | type
419      the output of an SQL Statement.
420    }
421  
422 +  TIBDateTimeFormats = (dfTimestamp, {SQL TIMESTAMP}
423 +                        dfDateTime,   {SQL DATETIME}
424 +                        dfTime);      {SQL TIME}
425 +
426    { IColumnMetaData }
427  
428    IColumnMetaData = interface
429 +    ['{c222e6c3-53c1-469f-9e05-0a5c3ef232d8}']
430      function GetIndex: integer;
431      function GetSQLType: cardinal;
432 <    function GetSQLTypeName: string;
432 >    function GetSQLTypeName: AnsiString;
433      function getSubtype: integer;
434 <    function getRelationName: string;
435 <    function getOwnerName: string;
436 <    function getSQLName: string;    {Name of the column}
437 <    function getAliasName: string;  {Alias Name of column or Column Name if no alias}
438 <    function getName: string;       {Disambiguated uppercase Field Name}
434 >    function getRelationName: AnsiString;
435 >    function getOwnerName: AnsiString;
436 >    function getSQLName: AnsiString;    {Name of the column}
437 >    function getAliasName: AnsiString;  {Alias Name of column or Column Name if no alias}
438 >    function getName: AnsiString;       {Disambiguated uppercase Field Name}
439      function getScale: integer;
440      function getCharSetID: cardinal;
441      function getCodePage: TSystemCodePage;
# Line 382 | Line 443 | type
443      function GetSize: cardinal;
444      function GetArrayMetaData: IArrayMetaData; {Valid only for Array SQL Type}
445      function GetBlobMetaData: IBlobMetaData; {Valid only for Blob SQL Type}
446 <    property Name: string read GetName;
446 >    function GetDateTimeStrLength(DateTimeFormat: TIBDateTimeFormats): integer;
447 >    function GetStatement: IStatement;
448 >    function GetTransaction: ITransaction;
449 >    property Name: AnsiString read GetName;
450      property Size: cardinal read GetSize;
451      property SQLType: cardinal read GetSQLType;
452      property Scale: integer read getScale;
# Line 398 | Line 462 | type
462    { IMetaData }
463  
464    IMetaData = interface
465 +    ['{4dafdbb6-0d36-4f1f-9c95-8b132804b965}']
466      function getCount: integer;
467      function getColumnMetaData(index: integer): IColumnMetaData;
468 <    function GetUniqueRelationName: string; {Non empty if all columns come from the same table}
469 <    function ByName(Idx: String): IColumnMetaData;
468 >    function GetUniqueRelationName: AnsiString; {Non empty if all columns come from the same table}
469 >    function ByName(Idx: AnsiString): IColumnMetaData;
470      property ColMetaData[index: integer]: IColumnMetaData read getColumnMetaData; default;
471      property Count: integer read getCount;
472    end;
# Line 421 | Line 486 | type
486  
487  
488    ISQLData = interface(IColumnMetaData)
489 +    ['{3f493e31-7e3f-4606-a07c-b210b9e3619d}']
490 +    function GetStrDataLength: short;
491      function GetAsBoolean: boolean;
492      function GetAsCurrency: Currency;
493      function GetAsInt64: Int64;
# Line 431 | Line 498 | type
498      function GetAsPointer: Pointer;
499      function GetAsQuad: TISC_QUAD;
500      function GetAsShort: short;
501 <    function GetAsString: String;
501 >    function GetAsString: AnsiString;
502      function GetIsNull: Boolean;
503      function GetAsVariant: Variant;
504      function GetAsBlob: IBlob; overload;
# Line 450 | Line 517 | type
517      property AsPointer: Pointer read GetAsPointer;
518      property AsQuad: TISC_QUAD read GetAsQuad;
519      property AsShort: short read GetAsShort;
520 <    property AsString: String read GetAsString;
520 >    property AsString: AnsiString read GetAsString;
521      property AsVariant: Variant read GetAsVariant ;
522      property AsBlob: IBlob read GetAsBlob;
523      property AsArray: IArray read GetAsArray;
# Line 465 | Line 532 | type
532    }
533  
534    IResults = interface
535 +    ['{e836b2bb-93d1-4bbf-a8eb-7ce535de3bb5}']
536     function getCount: integer;
537 +   function GetStatement: IStatement;
538     function GetTransaction: ITransaction;
539 <   function ByName(Idx: String): ISQLData;
539 >   function ByName(Idx: AnsiString): ISQLData;
540     function getSQLData(index: integer): ISQLData;
541 <   procedure GetData(index: integer; var IsNull:boolean; var len: short; var data: PChar);
541 >   procedure GetData(index: integer; var IsNull:boolean; var len: short; var data: PByte);
542     procedure SetRetainInterfaces(aValue: boolean);
543     property Data[index: integer]: ISQLData read getSQLData; default;
544     property Count: integer read getCount;
# Line 481 | Line 550 | type
550      in turn, used to access the data returned by each field of the current row.
551    }
552    IResultSet = interface(IResults)
553 +    ['{0ae4979b-7857-4e8c-8918-ec6f155b51a0}']
554      function FetchNext: boolean;
555 <    function GetCursorName: string;
555 >    function GetCursorName: AnsiString;
556      function IsEof: boolean;
557      procedure Close;
558    end;
# Line 503 | Line 573 | type
573    }
574  
575    ISQLParam = interface
576 +    ['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}']
577      function GetIndex: integer;
578      function GetSQLType: cardinal;
579 <    function GetSQLTypeName: string;
579 >    function GetSQLTypeName: AnsiString;
580      function getSubtype: integer;
581 <    function getName: string;
581 >    function getName: AnsiString;
582      function getScale: integer;
583      function getCharSetID: cardinal;
584      function getCodePage: TSystemCodePage;
# Line 523 | Line 594 | type
594      function GetAsPointer: Pointer;
595      function GetAsQuad: TISC_QUAD;
596      function GetAsShort: short;
597 <    function GetAsString: String;
597 >    function GetAsString: AnsiString;
598      function GetIsNull: boolean;
599      function GetAsVariant: Variant;
600      function GetAsBlob: IBlob;
# Line 541 | Line 612 | type
612      procedure SetAsFloat(aValue: Float);
613      procedure SetAsPointer(aValue: Pointer);
614      procedure SetAsShort(aValue: Short);
615 <    procedure SetAsString(aValue: String);
615 >    procedure SetAsString(aValue: AnsiString);
616      procedure SetAsVariant(aValue: Variant);
617      procedure SetIsNull(aValue: Boolean);
618      procedure SetAsBlob(aValue: IBlob);
# Line 560 | Line 631 | type
631      property AsLong: Long read GetAsLong write SetAsLong;
632      property AsPointer: Pointer read GetAsPointer write SetAsPointer;
633      property AsShort: Short read GetAsShort write SetAsShort;
634 <    property AsString: String read GetAsString write SetAsString;
634 >    property AsString: AnsiString read GetAsString write SetAsString;
635      property AsVariant: Variant read GetAsVariant write SetAsVariant;
636      property AsBlob: IBlob read GetAsBlob write SetAsBlob;
637      property AsArray: IArray read GetAsArray write SetAsArray;
# Line 569 | Line 640 | type
640      property IsNull: Boolean read GetIsNull write SetIsNull;
641      property IsNullable: Boolean read GetIsNullable;
642      property Modified: Boolean read getModified;
643 <    property Name: string read GetName;
643 >    property Name: AnsiString read GetName;
644      property SQLType: cardinal read GetSQLType;
645    end;
646  
# Line 579 | Line 650 | type
650    }
651  
652    ISQLParams = interface
653 +    ['{c6d95ac7-b2b7-461b-b890-afef0acbb077}']
654      function getCount: integer;
655      function getSQLParam(index: integer): ISQLParam;
656 <    function ByName(Idx: String): ISQLParam ;
656 >    function ByName(Idx: AnsiString): ISQLParam ;
657      function GetModified: Boolean;
658 +    function GetHasCaseSensitiveParams: Boolean;
659      property Modified: Boolean read GetModified;
660      property Params[index: integer]: ISQLParam read getSQLParam; default;
661      property Count: integer read getCount;
# Line 600 | Line 673 | type
673     }
674  
675    IStatement = interface
676 +    ['{a260576d-a07d-4a66-b02d-1b72543fd7cf}']
677      function GetMetaData: IMetaData;  {Output Metadata}
678      function GetSQLParams: ISQLParams;{Statement Parameters}
679 <    function GetPlan: String;
679 >    function GetPlan: AnsiString;
680      function GetRowsAffected(var SelectCount, InsertCount, UpdateCount, DeleteCount: integer): boolean;
681      function GetSQLStatementType: TIBSQLStatementTypes;
682 <    function GetSQLText: string;
682 >    function GetSQLText: AnsiString;
683 >    function GetProcessedSQLText: AnsiString;
684      function GetSQLDialect: integer;
685      function IsPrepared: boolean;
686      procedure Prepare(aTransaction: ITransaction=nil);
# Line 632 | Line 707 | type
707     found in the Interbase 6.0 API Guide.
708    }
709  
710 <  ITPBItem = interface(IParameterBlockItem) end;
710 >  ITPBItem = interface(IParameterBlockItem)
711 >    ['{544c1f2b-7c12-4a87-a4a5-face7ea72671}']
712 >  end;
713  
714 <  ITPB = specialize IParameterBlock<ITPBItem>;
714 >  ITPB = interface(IParameterBlock<ITPBItem>)
715 >    ['{7369b0ff-defe-437b-81fe-19b211d42d25}']
716 >  end;
717  
718    {The ITransactionAction interface provides access to a Transaction once it
719     has been initially started. After a Commit or Rollback, a transaction
# Line 648 | Line 727 | type
727    TTransactionCompletion = TARollback.. TACommit;
728  
729    ITransaction = interface
730 +    ['{30928d0e-a9d7-4c61-b7cf-14f4f38abe2a}']
731      function getTPB: ITPB;
732      procedure Start(DefaultCompletion: TTransactionCompletion=taCommit);
733      function GetInTransaction: boolean;
# Line 675 | Line 755 | type
755    }
756  
757    TEventInfo = record
758 <    EventName: string;
758 >    EventName: AnsiString;
759      Count: integer;
760    end;
761  
# Line 686 | Line 766 | type
766    { IEvents }
767  
768    IEvents = interface
769 +    ['{6a0be233-ed08-4524-889c-2e45d0c20e5f}']
770      procedure GetEvents(EventNames: TStrings);
771      procedure SetEvents(EventNames: TStrings); overload;
772 <    procedure SetEvents(EventName: string); overload;
772 >    procedure SetEvents(EventName: AnsiString); overload;
773      procedure Cancel;
774      function ExtractEventCounts: TEventCounts;
775      procedure WaitForEvent;
# Line 719 | Line 800 | type
800    TDBOperationCounts = array of TDBOperationCount;
801  
802    IDBInfoItem = interface
803 +    ['{eeb97b51-ec0f-473f-9f75-c1721f055fcb}']
804      function getItemType: byte;
805      function getSize: integer;
806      procedure getRawBytes(var Buffer);
807 <    function getAsString: string;
807 >    function getAsString: AnsiString;
808      function getAsInteger: integer;
809 <    procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: string);
809 >    procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: AnsiString);
810      function getAsBytes: TByteArray;
811 <    procedure DecodeVersionString(var Version: byte; var VersionString: string);
811 >    function getAsDateTime: TDateTime;
812 >    procedure DecodeVersionString(var Version: byte; var VersionString: AnsiString);
813      function getOperationCounts: TDBOperationCounts;
814      procedure DecodeUserNames(UserNames: TStrings);
815  
# Line 735 | Line 818 | type
818      function GetItem(index: integer): IDBInfoItem;
819      function Find(ItemType: byte): IDBInfoItem;
820      property AsInteger: integer read getAsInteger;
821 <    property AsString: string read GetAsString;
821 >    property AsString: AnsiString read GetAsString;
822      property Count: integer read GetCount;
823      property Items[index: integer]: IDBInfoItem read getItem; default;
824    end;
# Line 743 | Line 826 | type
826    { IDBInformation }
827  
828    IDBInformation = interface
829 +    ['{7ac6777f-f0a9-498a-9f5c-4a57a554df81}']
830      function GetCount: integer;
831      function GetItem(index: integer): IDBInfoItem;
832      function Find(ItemType: byte): IDBInfoItem;
# Line 751 | Line 835 | type
835      property Items[index: integer]: IDBInfoItem read getItem; default;
836    end;
837  
838 +  {The Database Information Request Block is used to pass requests for
839 +   database information where at least one item requested has a parameter.
840 +   At present, this is only fb_info_page_contents which has a single
841 +   integer parameter.}
842 +
843 +  IDIRBItem = interface(IParameterBlockItem)
844 +    ['{d34a7511-8435-4a24-81a7-5103d218d234}']
845 +  end;
846 +
847 +  IDIRB = interface(IParameterBlock<IDIRBItem>)
848 +    ['{1010e5ac-0a8f-403b-a302-91625e9d9579}']
849 +  end;
850 +
851 +
852    {The Database Parameter Block (DPB).
853  
854     The DPB provides the parameters used when connecting to a database. It is allocated
# Line 762 | Line 860 | type
860     found in the Interbase 6.0 API Guide.
861     }
862  
863 <  IDPBItem = interface(IParameterBlockItem) end;
863 >  IDPBItem = interface(IParameterBlockItem)
864 >    ['{123d4ad0-087a-4cd1-a344-1b3d03b30673}']
865 >  end;
866  
867 <  IDPB = specialize IParameterBlock<IDPBItem>;
867 >  IDPB = interface(IParameterBlock<IDPBItem>)
868 >    ['{e676067b-1cf4-4eba-9256-9724f57e0d16}']
869 >  end;
870  
871    {The IAttachment interface provides access to a Database Connection. It may be
872     used to:
# Line 794 | Line 896 | type
896    { IAttachment }
897  
898    IAttachment = interface
899 +    ['{466e9b67-9def-4807-b3e7-e08a35e7185c}']
900 +    function getFirebirdAPI: IFirebirdAPI;
901      function getDPB: IDPB;
902      function AllocateBPB: IBPB;
903 +    function AllocateDIRB: IDIRB;
904      procedure Connect;
905      procedure Disconnect(Force: boolean=false);
906      function IsConnected: boolean;
907      procedure DropDatabase;
908      function StartTransaction(TPB: array of byte; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload;
909      function StartTransaction(TPB: ITPB; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload;
910 <    procedure ExecImmediate(transaction: ITransaction; sql: string; SQLDialect: integer); overload;
911 <    procedure ExecImmediate(TPB: array of byte; sql: string; SQLDialect: integer); overload;
912 <    procedure ExecImmediate(transaction: ITransaction; sql: string); overload;
913 <    procedure ExecImmediate(TPB: array of byte; sql: string); overload;
914 <    function ExecuteSQL(TPB: array of byte; sql: string; SQLDialect: integer; params: array of const): IResults; overload;
915 <    function ExecuteSQL(transaction: ITransaction; sql: string; SQLDialect: integer; params: array of const): IResults; overload;
916 <    function ExecuteSQL(TPB: array of byte; sql: string; params: array of const): IResults; overload;
917 <    function ExecuteSQL(transaction: ITransaction; sql: string; params: array of const): IResults; overload;
918 <    function OpenCursor(transaction: ITransaction; sql: string; aSQLDialect: integer): IResultSet; overload;
919 <    function OpenCursor(transaction: ITransaction; sql: string; aSQLDialect: integer;
910 >    procedure ExecImmediate(transaction: ITransaction; sql: AnsiString; SQLDialect: integer); overload;
911 >    procedure ExecImmediate(TPB: array of byte; sql: AnsiString; SQLDialect: integer); overload;
912 >    procedure ExecImmediate(transaction: ITransaction; sql: AnsiString); overload;
913 >    procedure ExecImmediate(TPB: array of byte; sql: AnsiString); overload;
914 >    function ExecuteSQL(TPB: array of byte; sql: AnsiString; SQLDialect: integer; params: array of const): IResults; overload;
915 >    function ExecuteSQL(transaction: ITransaction; sql: AnsiString; SQLDialect: integer; params: array of const): IResults; overload;
916 >    function ExecuteSQL(TPB: array of byte; sql: AnsiString; params: array of const): IResults; overload;
917 >    function ExecuteSQL(transaction: ITransaction; sql: AnsiString; params: array of const): IResults; overload;
918 >    function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IResultSet; overload;
919 >    function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer;
920                               params: array of const): IResultSet; overload;
921 <    function OpenCursor(transaction: ITransaction; sql: string): IResultSet; overload;
922 <    function OpenCursor(transaction: ITransaction; sql: string;
921 >    function OpenCursor(transaction: ITransaction; sql: AnsiString): IResultSet; overload;
922 >    function OpenCursor(transaction: ITransaction; sql: AnsiString;
923                               params: array of const): IResultSet; overload;
924 <    function OpenCursorAtStart(transaction: ITransaction; sql: string; aSQLDialect: integer): IResultSet; overload;
925 <    function OpenCursorAtStart(transaction: ITransaction; sql: string; aSQLDialect: integer;
924 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IResultSet; overload;
925 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer;
926                               params: array of const): IResultSet; overload;
927 <    function OpenCursorAtStart(transaction: ITransaction; sql: string): IResultSet; overload;
928 <    function OpenCursorAtStart(transaction: ITransaction; sql: string;
927 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString): IResultSet; overload;
928 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString;
929                               params: array of const): IResultSet; overload;
930 <    function OpenCursorAtStart(sql: string): IResultSet; overload;
931 <    function OpenCursorAtStart(sql: string;
930 >    function OpenCursorAtStart(sql: AnsiString): IResultSet; overload;
931 >    function OpenCursorAtStart(sql: AnsiString;
932                               params: array of const): IResultSet; overload;
933 <    function Prepare(transaction: ITransaction; sql: string; aSQLDialect: integer): IStatement; overload;
934 <    function Prepare(transaction: ITransaction; sql: string): IStatement; overload;
935 <    function PrepareWithNamedParameters(transaction: ITransaction; sql: string;
936 <                       aSQLDialect: integer; GenerateParamNames: boolean=false): IStatement; overload;
937 <    function PrepareWithNamedParameters(transaction: ITransaction; sql: string;
938 <                       GenerateParamNames: boolean=false): IStatement; overload;
933 >    function Prepare(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IStatement; overload;
934 >    function Prepare(transaction: ITransaction; sql: AnsiString): IStatement; overload;
935 >    function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString;
936 >                       aSQLDialect: integer; GenerateParamNames: boolean=false;
937 >                       CaseSensitiveParams: boolean = false): IStatement; overload;
938 >    function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString;
939 >                       GenerateParamNames: boolean=false;
940 >                       CaseSensitiveParams: boolean = false): IStatement; overload;
941  
942      {Events}
943      function GetEventHandler(Events: TStrings): IEvents; overload;
944 <    function GetEventHandler(Event: string): IEvents; overload;
944 >    function GetEventHandler(Event: AnsiString): IEvents; overload;
945  
946      {Blob - may use to open existing Blobs. However, ISQLData.AsBlob is preferred}
947  
948 <    function CreateBlob(transaction: ITransaction; RelationName, ColumnName: string; BPB: IBPB=nil): IBlob; overload;
948 >    function CreateBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BPB: IBPB=nil): IBlob; overload;
949      function CreateBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BPB: IBPB=nil): IBlob; overload;
950      function CreateBlob(transaction: ITransaction; SubType: integer; CharSetID: cardinal=0; BPB: IBPB=nil): IBlob; overload;
951 <    function OpenBlob(transaction: ITransaction; RelationName, ColumnName: string; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob;
951 >    function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload;
952 >    function OpenBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob;  overload;
953  
954      {Array - may use to open existing arrays. However, ISQLData.AsArray is preferred}
955  
956 <    function OpenArray(transaction: ITransaction; RelationName, ColumnName: string; ArrayID: TISC_QUAD): IArray;
957 <    function CreateArray(transaction: ITransaction; RelationName, ColumnName: string): IArray; overload;
956 >    function OpenArray(transaction: ITransaction; RelationName, ColumnName: AnsiString; ArrayID: TISC_QUAD): IArray; overload;
957 >    function OpenArray(transaction: ITransaction; ArrayMetaData: IArrayMetaData; ArrayID: TISC_QUAD): IArray; overload;
958 >    function CreateArray(transaction: ITransaction; RelationName, ColumnName: AnsiString): IArray; overload;
959      function CreateArray(transaction: ITransaction; ArrayMetaData: IArrayMetaData): IArray; overload;
960 <    function CreateArrayMetaData(SQLType: cardinal; tableName: string; columnName: string;
960 >    function CreateArrayMetaData(SQLType: cardinal; tableName: AnsiString; columnName: AnsiString;
961                    Scale: integer; size: cardinal; charSetID: cardinal; dimensions: cardinal;
962                    bounds: TArrayBounds): IArrayMetaData;
963  
964      {Database Information}
965      function GetSQLDialect: integer;
966 <    function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: string): IBlobMetaData;
967 <    function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: string): IArrayMetaData;
966 >    function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IBlobMetaData;
967 >    function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IArrayMetaData;
968      function GetDBInformation(Requests: array of byte): IDBInformation; overload;
969      function GetDBInformation(Request: byte): IDBInformation; overload;
970 +    function GetDBInformation(Requests: IDIRB): IDBInformation; overload;
971 +    function GetConnectString: AnsiString;
972 +    function GetRemoteProtocol: AnsiString;
973 +    function GetAuthenticationMethod: AnsiString;
974 +    function GetSecurityDatabase: AnsiString;
975 +    function GetODSMajorVersion: integer;
976 +    function GetODSMinorVersion: integer;
977 +    procedure getFBVersion(version: TStrings);
978      function HasActivity: boolean;
979 +
980 +    {Character Sets}
981 +    function HasDefaultCharSet: boolean;
982 +    function GetDefaultCharSetID: integer;
983 +    function GetCharsetName(CharSetID: integer): AnsiString;
984 +    function CharSetID2CodePage(CharSetID: integer; var CodePage: TSystemCodePage): boolean;
985 +    function CodePage2CharSetID(CodePage: TSystemCodePage; var CharSetID: integer): boolean;
986 +    function CharSetName2CharSetID(CharSetName: AnsiString; var CharSetID: integer): boolean;
987 +    function CharSetWidth(CharSetID: integer; var Width: integer): boolean;
988 +    procedure RegisterCharSet(CharSetName: AnsiString; CodePage: TSystemCodePage;
989 +      AllowReverseLookup:boolean; out CharSetID: integer);
990    end;
991  
992 <  TProtocol = (TCP, SPX, NamedPipe, Local);
992 >  TProtocolAll = (TCP, SPX, NamedPipe, Local, inet, inet4, inet6, wnet, xnet, unknownProtocol);
993 >  TProtocol = TCP..xnet;
994  
995    {Service Parameter Block (SPB).
996  
# Line 875 | Line 1004 | type
1004  
1005    }
1006  
1007 <  ISPBItem = interface(IParameterBlockItem) end;
1007 >  ISPBItem = interface(IParameterBlockItem)
1008 >    ['{5d08ae2b-4519-41bd-8b40-97cd451c3f6a}']
1009 >  end;
1010  
1011 <  ISPB = specialize IParameterBlock<ISPBItem>;
1011 >  ISPB = interface(IParameterBlock<ISPBItem>)
1012 >    ['{2c5836fd-41ed-4426-9b7d-5af580ec2659}']
1013 >  end;
1014  
1015    {Service Query Parameter Block (SQPB).
1016  
# Line 886 | Line 1019 | type
1019    }
1020  
1021    ISQPBItem = interface(IParameterBlockItem)
1022 +    ['{b07841a6-33b3-47f0-b5a2-028cbc86dc97}']
1023      function CopyFrom(source: TStream; count: integer): integer;
1024    end;
1025  
1026 <  ISQPB = specialize IParameterBlock<ISQPBItem>;
1026 >  ISQPB = interface(IParameterBlock<ISQPBItem>)
1027 >    ['{8553e66b-ee62-498b-8431-dff030211447}']
1028 >  end;
1029  
1030    {Service Request Block (SRB).
1031  
# Line 903 | Line 1039 | type
1039  
1040    }
1041  
1042 <  ISRBItem = interface(IParameterBlockItem) end;
1042 >  ISRBItem = interface(IParameterBlockItem)
1043 >    ['{47ec790e-f265-4b30-9dcd-261e51677245}']
1044 >   end;
1045  
1046 <  ISRB = specialize IParameterBlock<ISRBItem>;
1046 >  ISRB = interface(IParameterBlock<ISRBItem>)
1047 >    ['{9f2e204f-3c33-4e44-90f9-9135e95dafb9}']
1048 >  end;
1049  
1050    {The Service Query Results Interface.
1051  
# Line 923 | Line 1063 | type
1063    }
1064  
1065    IServiceQueryResultSubItem = interface
1066 +    ['{8a4c381e-9923-4cc9-a96b-553729248640}']
1067      function getItemType: byte;
1068      function getSize: integer;
1069      procedure getRawBytes(var Buffer);
1070 <    function getAsString: string;
1070 >    function getAsString: AnsiString;
1071      function getAsInteger: integer;
1072      function getAsByte: byte;
1073      function CopyTo(stream: TStream; count: integer): integer;
1074 <    property AsString: string read getAsString;
1074 >    property AsString: AnsiString read getAsString;
1075      property AsInteger: integer read getAsInteger;
1076      property AsByte: byte read getAsByte;
1077    end;
1078  
1079    IServiceQueryResultItem = interface(IServiceQueryResultSubItem)
1080 +    ['{b2806886-206c-4024-8df9-5fe0a7630a5e}']
1081      function getCount: integer;
1082      function getItem(index: integer): IServiceQueryResultSubItem;
1083      function find(ItemType: byte): IServiceQueryResultSubItem;
# Line 944 | Line 1086 | type
1086    end;
1087  
1088    IServiceQueryResults = interface
1089 +    ['{8fbbef7d-fe03-4409-828a-a787d34ef531}']
1090      function getCount: integer;
1091      function getItem(index: integer): IServiceQueryResultItem;
1092      function find(ItemType: byte): IServiceQueryResultItem;
# Line 952 | Line 1095 | type
1095      property Count: integer read getCount;
1096    end;
1097  
1098 +  IFirebirdLibrary = interface;
1099 +
1100    {The IServiceManager interface provides access to a service manager. It can
1101     used to Detach and re-attach to Service Manager, to start services and to
1102     query the service manager.
# Line 962 | Line 1107 | type
1107    { IServiceManager }
1108  
1109    IServiceManager = interface
1110 +    ['{905b587d-1e1f-4e40-a3f8-a3519f852e48}']
1111 +    function getFirebirdAPI: IFirebirdAPI;
1112      function getSPB: ISPB;
1113 <    function getServerName: string;
1113 >    function getServerName: AnsiString;
1114 >    function getProtocol: TProtocol;
1115 >    function getPortNo: AnsiString;
1116      procedure Attach;
1117      procedure Detach(Force: boolean=false);
1118      function IsAttached: boolean;
1119      function AllocateSRB: ISRB;
1120      function AllocateSQPB: ISQPB;
1121 <    procedure Start(Request: ISRB);
1122 <    function Query(SQPB: ISQPB; Request: ISRB) :IServiceQueryResults; overload;
1123 <    function Query(Request: ISRB) :IServiceQueryResults; overload;
1121 >    function Start(Request: ISRB; RaiseExceptionOnError: boolean=true): boolean;
1122 >    function Query(SQPB: ISQPB; Request: ISRB; RaiseExceptionOnError: boolean=true) :IServiceQueryResults; overload;
1123 >    function Query(Request: ISRB; RaiseExceptionOnError: boolean=true) :IServiceQueryResults; overload;
1124 >  end;
1125 >
1126 >  {Tbe Firebird Library API used to get information about the Firebird library}
1127 >
1128 >
1129 >  IFirebirdLibrary = interface
1130 >    ['{3c04e0a1-12e0-428a-b2e1-bc6fcd97b79b}']
1131 >    function GetHandle: TLibHandle;
1132 >    function GetLibraryName: string;
1133 >    function GetLibraryFilePath: string;
1134 >    function GetFirebirdAPI: IFirebirdAPI;
1135    end;
1136  
1137    {The Firebird API.
# Line 983 | Line 1143 | type
1143    }
1144  
1145    IFirebirdAPI = interface
1146 +    ['{edeee691-c8d3-4dcf-a780-cd7e432821d5}']
1147      {Database connections}
1148      function AllocateDPB: IDPB;
1149 <    function OpenDatabase(DatabaseName: string; DPB: IDPB; RaiseExceptionOnConnectError: boolean=true): IAttachment;
1150 <    function CreateDatabase(DatabaseName: string; DPB: IDPB; RaiseExceptionOnError: boolean=true): IAttachment; overload;
1151 <    function CreateDatabase(sql: string; aSQLDialect: integer; RaiseExceptionOnError: boolean=true): IAttachment; overload;
1149 >    function OpenDatabase(DatabaseName: AnsiString; DPB: IDPB; RaiseExceptionOnConnectError: boolean=true): IAttachment;
1150 >    function CreateDatabase(DatabaseName: AnsiString; DPB: IDPB; RaiseExceptionOnError: boolean=true): IAttachment; overload;
1151 >    function CreateDatabase(sql: AnsiString; aSQLDialect: integer; RaiseExceptionOnError: boolean=true): IAttachment; overload;
1152  
1153      {Start Transaction against multiple databases}
1154      function AllocateTPB: ITPB;
# Line 999 | Line 1160 | type
1160      {Service Manager}
1161      function HasServiceAPI: boolean;
1162      function AllocateSPB: ISPB;
1163 <    function GetServiceManager(ServerName: string; Protocol: TProtocol; SPB: ISPB): IServiceManager;
1163 >    function GetServiceManager(ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB): IServiceManager; overload;
1164 >    function GetServiceManager(ServerName: AnsiString; Port: AnsiString; Protocol: TProtocol; SPB: ISPB): IServiceManager; overload;
1165  
1166      {Information}
1167      function GetStatus: IStatus;
1006    function GetLibraryName: string;
1168      function HasRollbackRetaining: boolean;
1169      function IsEmbeddedServer: boolean;
1170 <    function GetImplementationVersion: string;
1170 >    function GetImplementationVersion: AnsiString;
1171 >    function GetClientMajor: integer;
1172 >    function GetClientMinor: integer;
1173  
1174      {Firebird 3 API}
1175      function HasMasterIntf: boolean;
1176      function GetIMaster: TObject;
1177 <
1015 <    {utility}
1016 <    function GetCharsetName(CharSetID: integer): string;
1017 <    function CharSetID2CodePage(CharSetID: integer; var CodePage: TSystemCodePage): boolean;
1018 <    function CodePage2CharSetID(CodePage: TSystemCodePage; var CharSetID: integer): boolean;
1019 <    function CharSetName2CharSetID(CharSetName: string; var CharSetID: integer): boolean;
1020 <    function CharSetWidth(CharSetID: integer; var Width: integer): boolean;
1177 >    function GetFBLibrary: IFirebirdLibrary;
1178   end;
1179  
1180   type
# Line 1034 | Line 1191 | type
1191     private
1192       FSQLCode: Long;
1193     public
1194 <     constructor Create(ASQLCode: Long; Msg: string);
1194 >     constructor Create(ASQLCode: Long; Msg: AnsiString);
1195       property SQLCode: Long read FSQLCode;
1196     end;
1197  
# Line 1045 | Line 1202 | type
1202       FIBErrorCode: Long;
1203     public
1204       constructor Create(Status: IStatus); overload;
1205 <     constructor Create(ASQLCode: Long; AIBErrorCode: Long; Msg: string); overload;
1205 >     constructor Create(ASQLCode: Long; AIBErrorCode: Long; Msg: AnsiString); overload;
1206       property IBErrorCode: Long read FIBErrorCode;
1207     end;
1208  
1209     {IB Client Exceptions}
1210     EIBClientError = class(EIBError);
1211  
1055 {IBError is used internally and by IBX to throw an EIBClientError}
1056
1057 procedure IBError(ErrMess: TIBClientError; const Args: array of const);
1058
1212   {The Firebird API function is used to access the IFirebirdAPI interface.
1213  
1214   It will load the Firebird Client Library if this is not already loaded and
# Line 1070 | Line 1223 | function FirebirdAPI: IFirebirdAPI;
1223   function TryIBLoad: Boolean;
1224   procedure CheckIBLoaded;
1225  
1226 + {If you want to explicitly load the Firebird library from a
1227 + non-default location then use this function and its GetFirebirdAPI function
1228 + to get the API.}
1229 +
1230 + function LoadFBLibrary(aLibPathName: string): IFirebirdLibrary;
1231 +
1232   implementation
1233  
1234   uses FBClientAPI
1235    {$IFDEF USELEGACYFIREBIRDAPI}, FB25ClientAPI {$ENDIF}
1236    {$IFDEF USEFIREBIRD3API}, FB30ClientAPI {$ENDIF};
1237  
1238 < var FFirebirdAPI: IFirebirdAPI;
1238 > var FDefaultFBLibrary: IFirebirdLibrary;
1239 >
1240 > type
1241 >
1242 >  { TFBLibrary }
1243 >
1244 >  TFBLibraryImpl = class(TFBLibrary)
1245 >  protected
1246 >    function GetFirebird3API: IFirebirdAPI; override;
1247 >    function GetLegacyFirebirdAPI: IFirebirdAPI; override;
1248 >  end;
1249 >
1250 > function TFBLibraryImpl.GetFirebird3API: IFirebirdAPI;
1251 > begin
1252 > {$IFDEF USEFIREBIRD3API}
1253 > Result := TFB30ClientAPI.Create(self);
1254 > {$ELSE}
1255 > Result := nil;
1256 > {$ENDIF}
1257 > end;
1258 >
1259 > function TFBLibraryImpl.GetLegacyFirebirdAPI: IFirebirdAPI;
1260 > begin
1261 >  {$IFDEF USELEGACYFIREBIRDAPI}
1262 >  Result := TFB25ClientAPI.Create(self);
1263 >  {$ELSE}
1264 >  Result := nil;
1265 >  {$ENDIF}
1266 > end;
1267  
1268   function FirebirdAPI: IFirebirdAPI;
1269   begin
1270 <  if FFirebirdAPI = nil then
1270 >  if FDefaultFBLibrary = nil then
1271      CheckIBLoaded;
1272 <  Result := FFirebirdAPI;
1272 >  Result := FDefaultFBLibrary.GetFirebirdAPI;
1273   end;
1274  
1275   function TryIBLoad: Boolean;
1276 + var fblib: IFirebirdLibrary;
1277   begin
1278 < Result := FFirebirdAPI <> nil;
1278 > Result := FDefaultFBLibrary <> nil;
1279   try
1092  {$IFDEF USEFIREBIRD3API}
1280    if not Result then
1281    begin
1282 <    FFirebirdAPI := TFB30ClientAPI.Create;
1283 <    Result := FFirebirdAPI.HasMasterIntf;
1284 <  end;
1285 <  {$ENDIF}
1099 <  {$IFDEF USELEGACYFIREBIRDAPI}
1100 <  if not Result then
1101 <  begin
1102 <    FFirebirdAPI := nil;
1103 <    FFirebirdAPI := TFB25ClientAPI.Create;
1104 <    Result := true;
1105 <  end;
1106 <  {$ENDIF}
1107 <  if Result and not (FFirebirdAPI as TFBClientAPI).IsLibraryLoaded then
1108 <  begin
1109 <    Result := false;
1110 <    FFirebirdAPI := nil;
1282 >    fblib := TFBLibraryImpl.Create;
1283 >    if (fblib <> nil) and (fblib.GetFirebirdAPI <> nil) then
1284 >      FDefaultFBLibrary := fblib;
1285 >    Result := FDefaultFBLibrary <> nil;
1286    end;
1287   except
1288     SysUtils.showexception(ExceptObject,ExceptAddr);
# Line 1121 | Line 1296 | begin
1296      IBError(ibxeInterBaseMissing, [nil]);
1297   end;
1298  
1299 + function LoadFBLibrary(aLibPathName: string): IFirebirdLibrary;
1300 + var fblib: IFirebirdLibrary;
1301 + begin
1302 +  if trim(aLibPathName) = '' then
1303 +  begin
1304 +    CheckIBLoaded;
1305 +    Result := FDefaultFBLibrary;
1306 +  end
1307 +  else
1308 +  begin
1309 +    fblib := TFBLibraryImpl.GetFBLibrary(aLibPathName);
1310 +    if (fblib = nil) or (fblib.GetFirebirdAPI = nil) then
1311 +      IBError(ibxeInterBaseMissing, [nil]);
1312 +    Result := fblib;
1313 +  end;
1314 + end;
1315 +
1316   { EIBError }
1317  
1318 < constructor EIBError.Create(ASQLCode: Long; Msg: string);
1318 > constructor EIBError.Create(ASQLCode: Long; Msg: AnsiString);
1319   begin
1320    inherited Create(Msg);
1321    FSQLCode := ASQLCode;
# Line 1138 | Line 1330 | begin
1330   end;
1331  
1332   constructor EIBInterBaseError.Create(ASQLCode: Long; AIBErrorCode: Long;
1333 <  Msg: string);
1333 >  Msg: AnsiString);
1334   begin
1335    inherited Create(ASQLCode,Msg);
1336    FIBErrorCode := AIBErrorCode;
1337   end;
1338  
1147 procedure IBError(ErrMess: TIBClientError; const Args: array of const);
1148 begin
1149  raise EIBClientError.Create(Ord(ErrMess),
1150                              Format(GetErrorMessage(ErrMess), Args));
1151 end;
1339  
1340   initialization
1341 <  FFirebirdAPI := nil;
1341 >  FDefaultFBLibrary := nil;
1342  
1343 + finalization
1344 +  FDefaultFBLibrary := nil;
1345  
1346   end.
1347  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines