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

Comparing ibx/trunk/fbintf/client/2.5/FB25Attachment.pas (file contents):
Revision 60 by tony, Mon Mar 27 15:21:02 2017 UTC vs.
Revision 117 by tony, Mon Jan 22 13:58:11 2018 UTC

# Line 60 | Line 60 | type
60      {IAttachment}
61      procedure Connect;
62      procedure Disconnect(Force: boolean=false); override;
63 <    function IsConnected: boolean;
63 >    function IsConnected: boolean; override;
64      procedure DropDatabase;
65      function StartTransaction(TPB: array of byte; DefaultCompletion: TTransactionCompletion): ITransaction; override;
66      function StartTransaction(TPB: ITPB; DefaultCompletion: TTransactionCompletion): ITransaction; override;
# Line 89 | Line 89 | type
89  
90      function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IBlobMetaData;
91      function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IArrayMetaData;
92 <    function GetDBInformation(Requests: array of byte): IDBInformation; overload;
93 <    function GetDBInformation(Request: byte): IDBInformation; overload;
92 >    function GetDBInformation(Requests: array of byte): IDBInformation; overload; override;
93 >    function GetDBInformation(Request: byte): IDBInformation; overload; override;
94    end;
95  
96   implementation
97  
98   uses FB25Events,FB25Transaction, FBMessages, FB25Blob,
99 <  FB25Statement, FB25Array;
99 >  FB25Statement, FB25Array, IBUtils;
100  
101    { TFB25Attachment }
102  
# Line 136 | Line 136 | begin
136    begin
137      Disconnect;
138      Connect;
139 <  end;
139 >  end
140 >  else
141 >    GetODSAndConnectionInfo;
142   end;
143  
144   constructor TFB25Attachment.CreateDatabase(sql: AnsiString; aSQLDialect: integer;
145      RaiseExceptionOnError: boolean);
146   var tr_handle: TISC_TR_HANDLE;
145    info: IDBInformation;
146    ConnectionType: integer;
147    SiteName: AnsiString;
147   begin
148    inherited Create('',nil,RaiseExceptionOnError);
149    FSQLDialect := aSQLDialect;
# Line 155 | Line 154 | begin
154                                    aSQLDialect, nil) > 0) and RaiseExceptionOnError then
155        IBDataBaseError;
156  
158    FCharSetID := 0;
159    FCodePage := CP_NONE;
160    FHasDefaultCharSet := false;
161    info := GetDBInformation(isc_info_db_id);
162    info[0].DecodeIDCluster(ConnectionType,FDatabaseName,SiteName);
157    end;
158 +  GetODSAndConnectionInfo;
159 +  ExtractConnectString(sql,FDatabaseName);
160 +  DPBFromCreateSQL(sql);
161   end;
162  
163   procedure TFB25Attachment.Connect;
167 var Param: IDPBItem;
164   begin
165    FSQLDialect := 3;
166  
# Line 183 | Line 179 | begin
179                           (DPB as TDPB).getBuffer) > 0 ) and FRaiseExceptionOnConnectError then
180        IBDatabaseError;
181  
186    if IsConnected then
187    begin
188     Param := DPB.Find(isc_dpb_set_db_SQL_dialect);
189     if Param <> nil then
190       FSQLDialect := Param.AsByte;
191     Param :=  DPB.Find(isc_dpb_lc_ctype);
192     FHasDefaultCharSet :=  (Param <> nil) and
193                             CharSetName2CharSetID(Param.AsString,FCharSetID) and
194                             CharSetID2CodePage(FCharSetID,FCodePage) and
195                             (FCharSetID > 1);
196    end;
182    end;
183 +  GetODSAndConnectionInfo;
184   end;
185  
186   procedure TFB25Attachment.Disconnect(Force: boolean);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines