28 |
|
|
29 |
|
unit IB; |
30 |
|
|
31 |
+ |
{$Mode Delphi} |
32 |
+ |
|
33 |
|
interface |
34 |
|
|
35 |
|
uses |
36 |
< |
Windows, SysUtils, Classes, IBHeader, IBExternals, IBUtils, DB, IBXConst; |
36 |
> |
{$IFDEF LINUX } |
37 |
> |
unix, |
38 |
> |
{$ELSE} |
39 |
> |
Windows, |
40 |
> |
{$ENDIF} |
41 |
> |
SysUtils, Classes, IBExternals, IBUtils, DB, IBXConst; |
42 |
|
|
43 |
|
type |
44 |
|
TTraceFlag = (tfQPrepare, tfQExecute, tfQFetch, tfError, tfStmt, tfConnect, |
161 |
|
ibxeStartParamsError, |
162 |
|
ibxeOutputParsingError, |
163 |
|
ibxeUseSpecificProcedures, |
164 |
< |
ibxeSQLMonitorAlreadyPresent |
164 |
> |
ibxeSQLMonitorAlreadyPresent, |
165 |
> |
ibxeCantPrintValue, |
166 |
> |
ibxeEOFReached, |
167 |
> |
ibxeEOFInComment, |
168 |
> |
ibxeEOFInString, |
169 |
> |
ibxeParamNameExpected, |
170 |
> |
ibxeSuccess, |
171 |
> |
ibxeDelphiException, |
172 |
> |
ibxeNoOptionsSet, |
173 |
> |
ibxeNoDestinationDirectory, |
174 |
> |
ibxeNosourceDirectory, |
175 |
> |
ibxeNoUninstallFile, |
176 |
> |
ibxeOptionNeedsClient, |
177 |
> |
ibxeOptionNeedsServer, |
178 |
> |
ibxeInvalidOption, |
179 |
> |
ibxeInvalidOnErrorResult, |
180 |
> |
ibxeInvalidOnStatusResult, |
181 |
> |
ibxeDPBConstantUnknownEx, |
182 |
> |
ibxeTPBConstantUnknownEx |
183 |
|
); |
184 |
|
|
185 |
|
TStatusVector = array[0..19] of ISC_STATUS; |
187 |
|
|
188 |
|
|
189 |
|
const |
190 |
< |
IBPalette1 = 'InterBase'; {do not localize} |
191 |
< |
IBPalette2 = 'InterBase Admin'; {do not localize} |
190 |
> |
IBPalette1 = 'Firebird'; {do not localize} |
191 |
> |
IBPalette2 = 'Firebird Admin'; {do not localize} |
192 |
|
|
193 |
|
IBLocalBufferLength = 512; |
194 |
|
IBBigLocalBufferLength = IBLocalBufferLength * 2; |
292 |
|
SStartParamsError, |
293 |
|
SOutputParsingError, |
294 |
|
SUseSpecificProcedures, |
295 |
< |
SSQLMonitorAlreadyPresent |
295 |
> |
SSQLMonitorAlreadyPresent, |
296 |
> |
SCantPrintValue, |
297 |
> |
SEOFReached, |
298 |
> |
SEOFInComment, |
299 |
> |
SEOFInString, |
300 |
> |
SParamNameExpected, |
301 |
> |
SSuccess, |
302 |
> |
SDelphiException, |
303 |
> |
SNoOptionsSet, |
304 |
> |
SNoDestinationDirectory, |
305 |
> |
SNosourceDirectory, |
306 |
> |
SNoUninstallFile, |
307 |
> |
SOptionNeedsClient, |
308 |
> |
SOptionNeedsServer, |
309 |
> |
SInvalidOption, |
310 |
> |
SInvalidOnErrorResult, |
311 |
> |
SInvalidOnStatusResult, |
312 |
> |
SDPBConstantUnknownEx, |
313 |
> |
STPBConstantUnknownEx |
314 |
|
); |
315 |
|
|
316 |
|
var |
380 |
|
isc_sql_interprete(sqlcode, local_buffer, IBLocalBufferLength); |
381 |
|
if (ShowSQLCode in IBDataBaseErrorMessages) then |
382 |
|
usr_msg := usr_msg + CRLF; |
383 |
< |
usr_msg := usr_msg + string(local_buffer); |
383 |
> |
usr_msg := usr_msg + strpas(local_buffer); |
384 |
|
end; |
385 |
|
|
386 |
|
if (ShowIBMessage in IBDataBaseErrorMessages) then |
392 |
|
begin |
393 |
|
if (usr_msg <> '') and (usr_msg[Length(usr_msg)] <> LF) then |
394 |
|
usr_msg := usr_msg + CRLF; |
395 |
< |
usr_msg := usr_msg + string(local_buffer); |
395 |
> |
usr_msg := usr_msg + strpas(local_buffer); |
396 |
|
end; |
397 |
|
end; |
398 |
|
if (usr_msg <> '') and (usr_msg[Length(usr_msg)] = '.') then |
501 |
|
|
502 |
|
initialization |
503 |
|
IsMultiThread := True; |
504 |
< |
InitializeCriticalSection(IBCS); |
504 |
> |
InitCriticalSection(IBCS); |
505 |
|
IBDataBaseErrorMessages := [ShowSQLMessage, ShowIBMessage]; |
506 |
|
|
507 |
|
finalization |
508 |
< |
DeleteCriticalSection(IBCS); |
508 |
> |
DoneCriticalSection(IBCS); |
509 |
|
|
510 |
|
end. |