60 |
|
{ } |
61 |
|
{************************************************************************} |
62 |
|
unit FBMessages; |
63 |
+ |
{$IFDEF MSWINDOWS} |
64 |
+ |
{$DEFINE WINDOWS} |
65 |
+ |
{$ENDIF} |
66 |
|
|
67 |
|
{$IFDEF FPC} |
68 |
< |
{$mode objfpc}{$H+} |
68 |
> |
{$mode delphi} |
69 |
|
{$codepage UTF8} |
70 |
|
{$ENDIF} |
71 |
|
|
75 |
|
Classes, SysUtils; |
76 |
|
|
77 |
|
type |
75 |
– |
TIBDataBaseErrorMessage = (ShowSQLCode, |
76 |
– |
ShowIBMessage, |
77 |
– |
ShowSQLMessage); |
78 |
– |
|
79 |
– |
TIBDataBaseErrorMessages = set of TIBDataBaseErrorMessage; |
78 |
|
TIBClientError = ( |
81 |
– |
ibxeUnknownError, |
79 |
|
ibxeInterBaseMissing, |
83 |
– |
ibxeInterBaseInstallMissing, |
80 |
|
ibxeIB60feature, |
81 |
|
ibxeNotSupported, |
82 |
|
ibxeNotPermitted, |
87 |
– |
ibxeFileAccessError, |
88 |
– |
ibxeConnectionTimeout, |
89 |
– |
ibxeCannotSetDatabase, |
90 |
– |
ibxeCannotSetTransaction, |
91 |
– |
ibxeOperationCancelled, |
92 |
– |
ibxeDPBConstantNotSupported, |
93 |
– |
ibxeDPBConstantUnknown, |
94 |
– |
ibxeTPBConstantNotSupported, |
95 |
– |
ibxeTPBConstantUnknown, |
83 |
|
ibxeDatabaseClosed, |
97 |
– |
ibxeDatabaseOpen, |
98 |
– |
ibxeDatabaseNameMissing, |
84 |
|
ibxeNotInTransaction, |
100 |
– |
ibxeInTransaction, |
101 |
– |
ibxeTimeoutNegative, |
102 |
– |
ibxeNoDatabasesInTransaction, |
103 |
– |
ibxeUpdateWrongDB, |
104 |
– |
ibxeUpdateWrongTR, |
105 |
– |
ibxeDatabaseNotAssigned, |
85 |
|
ibxeTransactionNotAssigned, |
107 |
– |
ibxeXSQLDAIndexOutOfRange, |
108 |
– |
ibxeXSQLDANameDoesNotExist, |
86 |
|
ibxeEOF, |
87 |
|
ibxeBOF, |
88 |
|
ibxeInvalidStatementHandle, |
112 |
– |
ibxeSQLOpen, |
89 |
|
ibxeSQLClosed, |
114 |
– |
ibxeDatasetOpen, |
115 |
– |
ibxeDatasetClosed, |
90 |
|
ibxeUnknownSQLDataType, |
91 |
|
ibxeInvalidColumnIndex, |
118 |
– |
ibxeInvalidParamColumnIndex, |
92 |
|
ibxeInvalidDataConversion, |
120 |
– |
ibxeColumnIsNotNullable, |
93 |
|
ibxeBlobCannotBeRead, |
94 |
|
ibxeBlobCannotBeWritten, |
95 |
|
ibxeBlobNotOpen, |
96 |
|
ibxeEmptyQuery, |
125 |
– |
ibxeCannotOpenNonSQLSelect, |
126 |
– |
ibxeNoFieldAccess, |
127 |
– |
ibxeFieldReadOnly, |
97 |
|
ibxeFieldNotFound, |
129 |
– |
ibxeNotEditing, |
130 |
– |
ibxeCannotInsert, |
131 |
– |
ibxeCannotPost, |
132 |
– |
ibxeCannotUpdate, |
133 |
– |
ibxeCannotDelete, |
134 |
– |
ibxeCannotRefresh, |
135 |
– |
ibxeBufferNotSet, |
136 |
– |
ibxeCircularReference, |
98 |
|
ibxeSQLParseError, |
138 |
– |
ibxeUserAbort, |
139 |
– |
ibxeDataSetUniDirectional, |
140 |
– |
ibxeCannotCreateSharedResource, |
141 |
– |
ibxeWindowsAPIError, |
142 |
– |
ibxeColumnListsDontMatch, |
143 |
– |
ibxeColumnTypesDontMatch, |
144 |
– |
ibxeCantEndSharedTransaction, |
145 |
– |
ibxeFieldUnsupportedType, |
146 |
– |
ibxeCircularDataLink, |
147 |
– |
ibxeEmptySQLStatement, |
99 |
|
ibxeIsASelectStatement, |
149 |
– |
ibxeRequiredParamNotSet, |
150 |
– |
ibxeNoStoredProcName, |
100 |
|
ibxeIsAExecuteProcedure, |
152 |
– |
ibxeUpdateFailed, |
153 |
– |
ibxeNotCachedUpdates, |
154 |
– |
ibxeNotLiveRequest, |
155 |
– |
ibxeNoProvider, |
156 |
– |
ibxeNoRecordsAffected, |
157 |
– |
ibxeNoTableName, |
158 |
– |
ibxeCannotCreatePrimaryIndex, |
159 |
– |
ibxeCannotDropSystemIndex, |
160 |
– |
ibxeTableNameMismatch, |
161 |
– |
ibxeIndexFieldMissing, |
162 |
– |
ibxeInvalidCancellation, |
163 |
– |
ibxeInvalidEvent, |
101 |
|
ibxeMaximumEvents, |
165 |
– |
ibxeNoEventsRegistered, |
166 |
– |
ibxeInvalidQueueing, |
167 |
– |
ibxeInvalidRegistration, |
168 |
– |
ibxeInvalidBatchMove, |
169 |
– |
ibxeSQLDialectInvalid, |
170 |
– |
ibxeSPBConstantNotSupported, |
171 |
– |
ibxeSPBConstantUnknown, |
102 |
|
ibxeServiceActive, |
103 |
|
ibxeServiceInActive, |
104 |
|
ibxeServerNameMissing, |
175 |
– |
ibxeQueryParamsError, |
176 |
– |
ibxeStartParamsError, |
105 |
|
ibxeOutputParsingError, |
178 |
– |
ibxeUseSpecificProcedures, |
179 |
– |
ibxeSQLMonitorAlreadyPresent, |
180 |
– |
ibxeCantPrintValue, |
181 |
– |
ibxeEOFReached, |
182 |
– |
ibxeEOFInComment, |
183 |
– |
ibxeEOFInString, |
184 |
– |
ibxeParamNameExpected, |
185 |
– |
ibxeSuccess, |
186 |
– |
ibxeDelphiException, |
187 |
– |
ibxeNoOptionsSet, |
188 |
– |
ibxeNoDestinationDirectory, |
189 |
– |
ibxeNosourceDirectory, |
190 |
– |
ibxeNoUninstallFile, |
191 |
– |
ibxeOptionNeedsClient, |
192 |
– |
ibxeOptionNeedsServer, |
193 |
– |
ibxeInvalidOption, |
194 |
– |
ibxeInvalidOnErrorResult, |
195 |
– |
ibxeInvalidOnStatusResult, |
196 |
– |
ibxeDPBConstantUnknownEx, |
197 |
– |
ibxeTPBConstantUnknownEx, |
198 |
– |
ibxeSV5APIError, |
199 |
– |
ibxeThreadFailed, |
200 |
– |
ibxeFieldSizeError, |
201 |
– |
ibxeTransactionNotEnding, |
202 |
– |
ibxeDscInfoTokenMissing, |
203 |
– |
ibxeNoLoginDialog, |
106 |
|
ibxeEmptyAttachmentsList, |
205 |
– |
ibxeFirebirdLibraryLoaded, |
206 |
– |
ibxeInfoBufferIndexError, |
107 |
|
ibxeInfoBufferTypeError, |
208 |
– |
ibxeInfoBufferOverflow, |
108 |
|
ibxServiceRequestIndexError, |
109 |
|
ibxServiceParamTypeError, |
110 |
|
ibxeOutputBlockIndexError, |
122 |
|
ibxArrayBoundsCantIncrease , |
123 |
|
ibxeStatementNotPrepared, |
124 |
|
ibxeInterfaceOutofDate, |
226 |
– |
ibxeUnexpectedDatabaseInfoResp, |
125 |
|
ibxeInvalidBlobMetaData, |
126 |
|
ibxeNoDPB, |
127 |
|
ibxeInEventWait, |
129 |
|
ibxeMissingColumnName, |
130 |
|
ibxStringTooLong, |
131 |
|
ibxFieldNotinDataSet, |
234 |
– |
ibxeNotCurrentArray, |
132 |
|
ibxeNoDefaultCharacterSet, |
133 |
|
ibxeParamBufferOverflow, |
134 |
|
ibxeInvalidParamCount, |
135 |
|
ibxeInvalidVariantType, |
136 |
< |
ibxeServiceRunning |
136 |
> |
ibxeInterfaceNotSupported, |
137 |
> |
ibxeCharacterSetExists, |
138 |
> |
ibxeUnknownUserCharSet, |
139 |
> |
ibxeUninitializedInputParameter, |
140 |
> |
ibxeMultiThreadRequired, |
141 |
> |
ibxeTokenQueueOverflow, |
142 |
> |
ibxeTokenQueueUnderflow, |
143 |
> |
ibxErrorParsing, |
144 |
> |
ibxeDLInfoError, |
145 |
> |
ibxeDifferentAPIs |
146 |
|
); |
147 |
|
|
148 |
< |
function GetErrorMessage(ErrMess: TIBClientError): string; |
148 |
> |
function GetErrorMessage(ErrMess: TIBClientError): AnsiString; |
149 |
> |
|
150 |
> |
{IBError is used internally and by IBX to throw an EIBClientError} |
151 |
> |
|
152 |
> |
procedure IBError(ErrMess: TIBClientError; const Args: array of const); |
153 |
|
|
154 |
|
resourcestring |
155 |
|
{ generic strings used in code } |
246 |
– |
SEOFReached = 'SEOFReached'; |
247 |
– |
SEOFInComment = 'EOF in comment detected'; |
248 |
– |
SEOFInString = 'EOF in string detected'; |
156 |
|
SParamNameExpected = 'Parameter name expected'; |
250 |
– |
SCantPrintValue = 'Cannot print value'; |
251 |
– |
SSuccess = 'Successful execution'; |
252 |
– |
SDisconnectDatabase = 'Database is currently connected. Disconnect and continue?'; |
253 |
– |
SCommitTransaction = 'Transaction is currently Active. Rollback and continue?'; |
157 |
|
sSQLErrorSeparator = ' When Executing: '; |
255 |
– |
SNoDataSet = 'No dataset association'; |
256 |
– |
SSQLGenSelect = 'Must select at least one key field and one update field'; |
257 |
– |
SSQLNotGenerated = 'Update SQL statements not generated, exit anyway?'; |
258 |
– |
SSQLDataSetOpen = 'Unable to determine field names for %s'; |
259 |
– |
SDefaultTransaction = '%s, Default'; |
158 |
|
SFirebirdAPIFuncNotFound = 'Unable to load Firebird Client Library Function "%s"'; |
261 |
– |
SDatabaseFilter = 'Database Files (*.fdb; *.gdb)|*.gdb; *.fdb|All files (*.*)|*.*'; |
159 |
|
STrue = 'true'; |
160 |
|
SFalse = 'false'; |
161 |
+ |
SArray = '(array)'; |
162 |
|
|
163 |
|
implementation |
164 |
|
|
165 |
< |
uses IBUtils; |
165 |
> |
uses IBUtils, IB; |
166 |
|
|
167 |
|
resourcestring |
168 |
|
|
169 |
|
{ strings used in error messages} |
272 |
– |
SUnknownError = 'Unknown error'; |
170 |
|
SInterBaseMissing = 'Firebird library not found in the path. Please install Firebird to use this functionality'; |
274 |
– |
SInterBaseInstallMissing = 'InterBase Install DLL ibinstall.dll not found in the path. Please install InterBase 6 to use this functionality'; |
171 |
|
SIB60feature = '%s is an InterBase 6 function. Please upgrade to InterBase 6 to use this functonality'; |
172 |
|
SNotSupported = 'Unsupported feature'; |
173 |
|
SNotPermitted = 'Not permitted'; |
278 |
– |
SFileAccessError = 'Temporary file access error'; |
279 |
– |
SConnectionTimeout = 'Database connection timed out'; |
280 |
– |
SCannotSetDatabase = 'Cannot set database'; |
281 |
– |
SCannotSetTransaction = 'Cannot set transaction'; |
282 |
– |
SOperationCancelled = 'Operation cancelled at user''s request'; |
283 |
– |
SDPBConstantNotSupported = 'DPB Constant (isc_dpb_%s) is unsupported'; |
284 |
– |
SDPBConstantUnknown = 'DPB Constant (%d) is unknown'; |
285 |
– |
STPBConstantNotSupported = 'TPB Constant (isc_tpb_%s) is unsupported'; |
286 |
– |
STPBConstantUnknown = 'TPB Constant (%d) is unknown'; |
174 |
|
SDatabaseClosed = 'Cannot perform operation -- DB is not open'; |
288 |
– |
SDatabaseOpen = 'Cannot perform operation -- DB is currently open'; |
289 |
– |
SDatabaseNameMissing = 'Database name is missing'; |
175 |
|
SNotInTransaction = 'Transaction is not active'; |
291 |
– |
SInTransaction = 'Transaction is active'; |
292 |
– |
STimeoutNegative = 'Timeout values cannot be negative'; |
293 |
– |
SNoDatabasesInTransaction = 'No databases are listed in transaction component'; |
294 |
– |
SUpdateWrongDB = 'Updating wrong database'; |
295 |
– |
SUpdateWrongTR = 'Updating wrong transaction. Unique transaction expected in set'; |
296 |
– |
SDatabaseNotAssigned = 'Database not assigned'; |
176 |
|
STransactionNotAssigned = 'Transaction not assigned'; |
298 |
– |
SXSQLDAIndexOutOfRange = 'XSQLDA index out of range'; |
299 |
– |
SXSQLDANameDoesNotExist = 'XSQLDA name does not exist (%s)'; |
177 |
|
SEOF = 'End of file'; |
178 |
|
SBOF = 'Beginning of file'; |
179 |
|
SInvalidStatementHandle = 'Invalid statement handle'; |
303 |
– |
SSQLOpen = 'IBSQL Open'; |
180 |
|
SSQLClosed = 'IBSQL Closed'; |
305 |
– |
SDatasetOpen = 'Dataset open'; |
306 |
– |
SDatasetClosed = 'Dataset closed'; |
181 |
|
SUnknownSQLDataType = 'Unknown SQL Data type (%d)'; |
182 |
|
SInvalidColumnIndex = 'Invalid column index (index exceeds permitted range)'; |
309 |
– |
SInvalidParamColumnIndex = 'Invalid parameter index (index exceeds permitted range)'; |
183 |
|
SInvalidDataConversion = 'Invalid data conversion'; |
311 |
– |
SColumnIsNotNullable = 'Column cannot be set to null (%s)'; |
184 |
|
SBlobCannotBeRead = 'Blob stream cannot be read'; |
185 |
|
SBlobCannotBeWritten = 'Blob stream cannot be written'; |
186 |
|
SBlobNotOpen = 'The Blob is not open'; |
187 |
|
SEmptyQuery = 'Empty query'; |
316 |
– |
SCannotOpenNonSQLSelect = 'Cannot "open" a non-select statement. Use ExecQuery'; |
317 |
– |
SNoFieldAccess = 'No access to field "%s"'; |
318 |
– |
SFieldReadOnly = 'Field "%s" is read-only'; |
188 |
|
SFieldNotFound = 'Field "%s" not found'; |
320 |
– |
SNotEditing = 'Not in edit mode'; |
321 |
– |
SCannotInsert = 'Cannot insert into dataset. (No insert query)'; |
322 |
– |
SCannotPost = 'Cannot post. (No update/insert query)'; |
323 |
– |
SCannotUpdate = 'Cannot update. (No update query)'; |
324 |
– |
SCannotDelete = 'Cannot delete from dataset. (No delete query)'; |
325 |
– |
SCannotRefresh = 'Cannot refresh row. (No refresh query)'; |
326 |
– |
SBufferNotSet = 'Buffer not set'; |
327 |
– |
SCircularReference = 'Circular references not permitted'; |
189 |
|
SSQLParseError = 'SQL Parse Error:' + CRLF + CRLF + '%s'; |
329 |
– |
SUserAbort = 'User abort'; |
330 |
– |
SDataSetUniDirectional = 'Data set is uni-directional'; |
331 |
– |
{$IFDEF UNIX} |
332 |
– |
SCannotCreateSharedResource = 'Cannot create shared resource. %s'; |
333 |
– |
{$ELSE} |
334 |
– |
SCannotCreateSharedResource = 'Cannot create shared resource. (Windows error %d)'; |
335 |
– |
{$ENDIF} |
336 |
– |
SWindowsAPIError = 'Windows API error. (Windows error %d [$%.8x])'; |
337 |
– |
SColumnListsDontMatch = 'Column lists do not match'; |
338 |
– |
SColumnTypesDontMatch = 'Column types don''t match. (From index: %d; To index: %d)'; |
339 |
– |
SCantEndSharedTransaction = 'Can''t end a shared transaction unless it is forced and equal ' + |
340 |
– |
'to the transaction''s TimeoutAction'; |
341 |
– |
SFieldUnsupportedType = 'Unsupported Field Type'; |
342 |
– |
SCircularDataLink = 'Circular DataLink Reference'; |
343 |
– |
SEmptySQLStatement = 'Empty SQL Statement'; |
190 |
|
SIsASelectStatement = 'use Open for a Select Statement'; |
345 |
– |
SRequiredParamNotSet = 'Required parameter "%s" value not set'; |
346 |
– |
SNoStoredProcName = 'No Stored Procedure Name assigned'; |
191 |
|
SIsAExecuteProcedure = 'use ExecProc for Procedure; use TQuery for Select procedures'; |
348 |
– |
SUpdateFailed = 'Update Failed'; |
349 |
– |
SNotCachedUpdates = 'CachedUpdates not enabled'; |
350 |
– |
SNotLiveRequest = 'Request is not live - cannot modify'; |
351 |
– |
SNoProvider = 'No Provider'; |
352 |
– |
SNoRecordsAffected = 'No Records Affected'; |
353 |
– |
SNoTableName = 'No Table Name assigned'; |
354 |
– |
SCannotCreatePrimaryIndex = 'Cannot Create Primary Index; are created automatically'; |
355 |
– |
SCannotDropSystemIndex = 'Cannot Drop System Index'; |
356 |
– |
STableNameMismatch = 'Table Name Mismatch'; |
357 |
– |
SIndexFieldMissing = 'Index Field Missing'; |
358 |
– |
SInvalidCancellation = 'Cannot Cancel events while processing'; |
359 |
– |
SInvalidEvent = 'Invalid Event'; |
192 |
|
SMaximumEvents = 'Exceded Maximum Event limits'; |
361 |
– |
SNoEventsRegistered = 'No Events Registered'; |
362 |
– |
SInvalidQueueing = 'Invalid Queueing'; |
363 |
– |
SInvalidRegistration = 'Invalid Registration'; |
364 |
– |
SInvalidBatchMove = 'Invalid Batch Move'; |
365 |
– |
SSQLDialectInvalid = 'SQL Dialect Invalid'; |
366 |
– |
SSPBConstantNotSupported = 'SPB Constant Not supported'; |
367 |
– |
SSPBConstantUnknown = 'SPB Constant Unknown'; |
193 |
|
SServiceActive = 'Cannot perform operation -- service is not attached'; |
194 |
|
SServiceInActive = 'Cannot perform operation -- service is attached'; |
195 |
|
SServerNameMissing = 'Server Name Missing'; |
196 |
< |
SQueryParamsError = 'Query Parameters missing or incorrect'; |
372 |
< |
SStartParamsError = 'start Parameters missing or incorrect'; |
373 |
< |
SOutputParsingError = 'Unexpected Output buffer value (%d)'; |
374 |
< |
SUseSpecificProcedures = 'Generic ServiceStart not applicable: Use Specific Procedures to set configuration params'; |
375 |
< |
SSQLMonitorAlreadyPresent = 'SQL Monitor Instance is already present'; |
376 |
< |
SDelphiException = 'DelphiException %s'; |
377 |
< |
SNoOptionsSet = 'No Install Options selected'; |
378 |
< |
SNoDestinationDirectory = 'DestinationDirectory is not set'; |
379 |
< |
SNosourceDirectory = 'SourceDirectory is not set'; |
380 |
< |
SNoUninstallFile = 'Uninstall File Name is not set'; |
381 |
< |
SOptionNeedsClient = '%s component requires Client to function properly'; |
382 |
< |
SOptionNeedsServer = '%s component requires Server to function properly'; |
383 |
< |
SInvalidOption = 'Invalid option specified'; |
384 |
< |
SInvalidOnErrorResult = 'Unexpected onError return value'; |
385 |
< |
SInvalidOnStatusResult = 'Unexpected onStatus return value'; |
386 |
< |
|
387 |
< |
SDPBConstantUnknownEx = 'DPB Constant (%s) is unknown'; |
388 |
< |
STPBConstantUnknownEx = 'TPB Constant (%s) is unknown'; |
389 |
< |
SSV5APIError = 'SV5 API API Error - %s'; |
390 |
< |
SThreadFailed = '%s Thread failed with Exception: %s'; |
391 |
< |
sFieldSizeError = 'Field %s is too small to receive the data'; |
392 |
< |
STransactionNotEnding = 'Transaction is not being completed'; |
393 |
< |
SDscInfoTokenMissing = '%s token not found'; |
394 |
< |
SNoLoginDialog = 'Default Login Dlalog not found. Have you included ibexpress ' + |
395 |
< |
'in your program uses list?'; |
196 |
> |
SOutputParsingError = 'Unexpected Output buffer value (%d) - %s'; |
197 |
|
SEmptyAttachmentsList = 'The list of database attachments cannot be empty'; |
397 |
– |
SFirebirdLibraryLoaded = 'The Firebird Library is already loaded'; |
398 |
– |
SInfoBufferIndexError = 'Info Buffer Index Out of Range (%d)'; |
198 |
|
SInfoBufferTypeError = 'Invalid operation for Info Buffer Type (%d)'; |
400 |
– |
SInfoBufferOverflow = 'Info Buffer overlow'; |
199 |
|
SServiceRequestIndexError = 'Service Request Index Out of Range (%d)'; |
200 |
|
SServiceParamTypeError = 'Invalid Request for Service Param Type'; |
201 |
|
SOutputBlockIndexError = 'Output Block Index Out of Range (%d)'; |
203 |
|
SPBIndexError = 'DPB Index out of range (%d)'; |
204 |
|
SPBParamTypeError = 'Invalid Request for DPB Param Type'; |
205 |
|
SDuplicateParamName = 'Blob or array parameter name must be unique (%s)'; |
206 |
< |
SInvalidArrayDimensions = 'Invalid number of array dimensions {%d)'; |
206 |
> |
SInvalidArrayDimensions = 'Invalid number of array dimensions (%d)'; |
207 |
|
SNotAMultiDatabaseTransaction = 'This is not a multi-database transaction'; |
208 |
|
SAttachmentListIndexError = 'Attachment List index out of range (%d)'; |
209 |
|
SNotAnArray = 'Table Column must be an array'; |
213 |
|
SArrayBoundsCantIncrease = 'Array Bounds can only be narrowed'; |
214 |
|
SStatementNotPrepared = 'The Statement has not been prepared'; |
215 |
|
SInterfaceOutofDate = 'This interface is no longer up-to-date'; |
418 |
– |
SUnexpectedDatabaseInfoResp = 'Unexpected Database Information Response'; |
216 |
|
SInvalidBlobMetaData = 'Unable to Access Blob Meta Data'; |
217 |
|
SNoDPB = 'A DPB must be provided'; |
218 |
|
SInEventWait = 'Already in Event Wait State'; |
220 |
|
SMissingColumnName = 'Relation or Column Name Missing'; |
221 |
|
SStringTooLong = 'String "%s" is too long. Max %d characters'; |
222 |
|
SFieldNotinDataSet = 'Field %s is not a member of DataSet %s'; |
426 |
– |
SNotCurrentArray = 'Cannot Edit an Array that is not part of the current record'; |
223 |
|
SNoDefaultCharacterSet = 'A connection default character set is required to perform this operation'; |
224 |
|
SParamBufferOverflow = 'Parameter Buffer Overflow'; |
225 |
|
SInvalidParamCount = 'Invalid Parameter Count. %d expected, %d found'; |
226 |
|
SInvalidVariantType = 'Invalid variant type'; |
227 |
< |
SServiceRunning = 'Cannot start a new service while an existing service is running'; |
227 |
> |
SInterfaceNotSupported = 'Interface not supported; Guid %s not found'; |
228 |
> |
SCharacterSetExists = 'Character set "%s" is already defined'; |
229 |
> |
SUnknownUserCharSet = 'Unknown user character set "%s"'; |
230 |
> |
SUninitializedInputParameter = 'SQL Param No. %d (%s) is uninitialised'; |
231 |
> |
SMultiThreadRequired = 'Multi-threading required for %s but not enabled. Please recompile with multi-threading support enabled. '+ |
232 |
> |
'Hint: you probably need to add -dUseCThreads to the Custom Options.'; |
233 |
> |
STokenQueueOverflow = 'Error in SQL Token Analyser - token queue overflow'; |
234 |
> |
STokenQueueUnderflow = 'Error in SQL Token Analyser - token queue underflow'; |
235 |
> |
SErrorParsing = 'Error parsing SQL Statement at clause starting with %s'; |
236 |
> |
SDLInfoError = 'dlinfo returned error - %s'; |
237 |
> |
SDifferentAPIs = 'All transaction attachments must use the same Firebird Library'; |
238 |
|
|
239 |
|
const |
240 |
|
IBErrorMessages: array[TIBClientError] of string = ( |
435 |
– |
SUnknownError, |
241 |
|
SInterBaseMissing, |
437 |
– |
SInterBaseInstallMissing, |
242 |
|
SIB60feature, |
243 |
|
SNotSupported, |
244 |
|
SNotPermitted, |
441 |
– |
SFileAccessError, |
442 |
– |
SConnectionTimeout, |
443 |
– |
SCannotSetDatabase, |
444 |
– |
SCannotSetTransaction, |
445 |
– |
SOperationCancelled, |
446 |
– |
SDPBConstantNotSupported, |
447 |
– |
SDPBConstantUnknown, |
448 |
– |
STPBConstantNotSupported, |
449 |
– |
STPBConstantUnknown, |
245 |
|
SDatabaseClosed, |
451 |
– |
SDatabaseOpen, |
452 |
– |
SDatabaseNameMissing, |
246 |
|
SNotInTransaction, |
454 |
– |
SInTransaction, |
455 |
– |
STimeoutNegative, |
456 |
– |
SNoDatabasesInTransaction, |
457 |
– |
SUpdateWrongDB, |
458 |
– |
SUpdateWrongTR, |
459 |
– |
SDatabaseNotAssigned, |
247 |
|
STransactionNotAssigned, |
461 |
– |
SXSQLDAIndexOutOfRange, |
462 |
– |
SXSQLDANameDoesNotExist, |
248 |
|
SEOF, |
249 |
|
SBOF, |
250 |
|
SInvalidStatementHandle, |
466 |
– |
SSQLOpen, |
251 |
|
SSQLClosed, |
468 |
– |
SDatasetOpen, |
469 |
– |
SDatasetClosed, |
252 |
|
SUnknownSQLDataType, |
253 |
|
SInvalidColumnIndex, |
472 |
– |
SInvalidParamColumnIndex, |
254 |
|
SInvalidDataConversion, |
474 |
– |
SColumnIsNotNullable, |
255 |
|
SBlobCannotBeRead, |
256 |
|
SBlobCannotBeWritten, |
257 |
|
SBlobNotOpen, |
258 |
|
SEmptyQuery, |
479 |
– |
SCannotOpenNonSQLSelect, |
480 |
– |
SNoFieldAccess, |
481 |
– |
SFieldReadOnly, |
259 |
|
SFieldNotFound, |
483 |
– |
SNotEditing, |
484 |
– |
SCannotInsert, |
485 |
– |
SCannotPost, |
486 |
– |
SCannotUpdate, |
487 |
– |
SCannotDelete, |
488 |
– |
SCannotRefresh, |
489 |
– |
SBufferNotSet, |
490 |
– |
SCircularReference, |
260 |
|
SSQLParseError, |
492 |
– |
SUserAbort, |
493 |
– |
SDataSetUniDirectional, |
494 |
– |
SCannotCreateSharedResource, |
495 |
– |
SWindowsAPIError, |
496 |
– |
SColumnListsDontMatch, |
497 |
– |
SColumnTypesDontMatch, |
498 |
– |
SCantEndSharedTransaction, |
499 |
– |
SFieldUnsupportedType, |
500 |
– |
SCircularDataLink, |
501 |
– |
SEmptySQLStatement, |
261 |
|
SIsASelectStatement, |
503 |
– |
SRequiredParamNotSet, |
504 |
– |
SNoStoredProcName, |
262 |
|
SIsAExecuteProcedure, |
506 |
– |
SUpdateFailed, |
507 |
– |
SNotCachedUpdates, |
508 |
– |
SNotLiveRequest, |
509 |
– |
SNoProvider, |
510 |
– |
SNoRecordsAffected, |
511 |
– |
SNoTableName, |
512 |
– |
SCannotCreatePrimaryIndex, |
513 |
– |
SCannotDropSystemIndex, |
514 |
– |
STableNameMismatch, |
515 |
– |
SIndexFieldMissing, |
516 |
– |
SInvalidCancellation, |
517 |
– |
SInvalidEvent, |
263 |
|
SMaximumEvents, |
519 |
– |
SNoEventsRegistered, |
520 |
– |
SInvalidQueueing, |
521 |
– |
SInvalidRegistration, |
522 |
– |
SInvalidBatchMove, |
523 |
– |
SSQLDialectInvalid, |
524 |
– |
SSPBConstantNotSupported, |
525 |
– |
SSPBConstantUnknown, |
264 |
|
SServiceActive, |
265 |
|
SServiceInActive, |
266 |
|
SServerNameMissing, |
529 |
– |
SQueryParamsError, |
530 |
– |
SStartParamsError, |
267 |
|
SOutputParsingError, |
532 |
– |
SUseSpecificProcedures, |
533 |
– |
SSQLMonitorAlreadyPresent, |
534 |
– |
SCantPrintValue, |
535 |
– |
SEOFReached, |
536 |
– |
SEOFInComment, |
537 |
– |
SEOFInString, |
538 |
– |
SParamNameExpected, |
539 |
– |
SSuccess, |
540 |
– |
SDelphiException, |
541 |
– |
SNoOptionsSet, |
542 |
– |
SNoDestinationDirectory, |
543 |
– |
SNosourceDirectory, |
544 |
– |
SNoUninstallFile, |
545 |
– |
SOptionNeedsClient, |
546 |
– |
SOptionNeedsServer, |
547 |
– |
SInvalidOption, |
548 |
– |
SInvalidOnErrorResult, |
549 |
– |
SInvalidOnStatusResult, |
550 |
– |
SDPBConstantUnknownEx, |
551 |
– |
STPBConstantUnknownEx, |
552 |
– |
SSV5APIError, |
553 |
– |
SThreadFailed, |
554 |
– |
SFieldSizeError, |
555 |
– |
STransactionNotEnding, |
556 |
– |
SDscInfoTokenMissing, |
557 |
– |
SNoLoginDialog, |
268 |
|
SEmptyAttachmentsList, |
559 |
– |
SFirebirdLibraryLoaded, |
560 |
– |
SInfoBufferIndexError, |
269 |
|
SInfoBufferTypeError, |
562 |
– |
SInfoBufferOverflow, |
270 |
|
SServiceRequestIndexError, |
271 |
|
SServiceParamTypeError, |
272 |
|
SOutputBlockIndexError, |
284 |
|
SArrayBoundsCantIncrease, |
285 |
|
SStatementNotPrepared, |
286 |
|
SInterfaceOutofDate, |
580 |
– |
SUnexpectedDatabaseInfoResp, |
287 |
|
SInvalidBlobMetaData, |
288 |
|
SNoDPB, |
289 |
|
SInEventWait, |
291 |
|
SMissingColumnName, |
292 |
|
SStringTooLong, |
293 |
|
SFieldNotinDataSet, |
588 |
– |
SNotCurrentArray, |
294 |
|
SNoDefaultCharacterSet, |
295 |
|
SParamBufferOverflow, |
296 |
|
SInvalidParamCount, |
297 |
|
SInvalidVariantType, |
298 |
< |
SServiceRunning |
298 |
> |
SInterfaceNotSupported, |
299 |
> |
SCharacterSetExists, |
300 |
> |
SUnknownUserCharSet, |
301 |
> |
SUninitializedInputParameter, |
302 |
> |
SMultiThreadRequired, |
303 |
> |
STokenQueueOverflow, |
304 |
> |
STokenQueueUnderflow, |
305 |
> |
SErrorParsing, |
306 |
> |
SDLInfoError, |
307 |
> |
SDifferentAPIs |
308 |
|
); |
309 |
|
|
310 |
< |
function GetErrorMessage(ErrMess: TIBClientError): string; |
310 |
> |
function GetErrorMessage(ErrMess: TIBClientError): AnsiString; |
311 |
|
begin |
312 |
|
Result := IBErrorMessages[ErrMess]; |
313 |
|
end; |
314 |
|
|
315 |
+ |
procedure IBError(ErrMess: TIBClientError; const Args: array of const); |
316 |
+ |
begin |
317 |
+ |
raise EIBClientError.Create(Ord(ErrMess), |
318 |
+ |
Format(GetErrorMessage(ErrMess), Args)); |
319 |
+ |
end; |
320 |
+ |
|
321 |
|
end. |
322 |
|
|