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

Comparing ibx/branches/udr/client/FBClientAPI.pas (file contents):
Revision 384 by tony, Mon Jan 10 10:08:03 2022 UTC vs.
Revision 385 by tony, Mon Jan 17 15:56:35 2022 UTC

# Line 119 | Line 119 | type
119    private
120      FIBDataBaseErrorMessages: TIBDataBaseErrorMessages;
121      FPrefix: AnsiString;
122 +    function SQLCodeSupported: boolean;
123    protected
124      FOwner: TFBClientAPI;
125      function GetIBMessage: Ansistring; virtual; abstract;
# Line 612 | Line 613 | end;
613  
614   { TFBStatus }
615  
616 + function TFBStatus.SQLCodeSupported: boolean;
617 + begin
618 +  Result:= (FOwner <> nil) and assigned(FOwner.isc_sqlcode) and  assigned(FOwner.isc_sql_interprete);
619 + end;
620 +
621   function TFBStatus.GetSQLMessage: Ansistring;
622   var local_buffer: array[0..IBHugeLocalBufferLength - 1] of AnsiChar;
623   begin
# Line 628 | Line 634 | begin
634    inherited Create;
635    FOwner := aOwner;
636    FPrefix := prefix;
637 <  FIBDataBaseErrorMessages := [ShowSQLCode, ShowSQLMessage, ShowIBMessage];
637 >  FIBDataBaseErrorMessages := [ShowIBMessage];
638   end;
639  
640   function TFBStatus.GetIBErrorCode: TStatusCode;
# Line 649 | Line 655 | var IBDataBaseErrorMessages: TIBDataBase
655   begin
656    Result := FPrefix;
657    IBDataBaseErrorMessages := FIBDataBaseErrorMessages;
658 <  if (ShowSQLCode in IBDataBaseErrorMessages) then
653 <    Result := Result + 'SQLCODE: ' + IntToStr(Getsqlcode); {do not localize}
654 <
655 <  if [ShowSQLMessage, ShowIBMessage]*IBDataBaseErrorMessages <> [] then
658 >  if SQLCodeSupported then
659    begin
660 <    if (ShowSQLCode in FIBDataBaseErrorMessages) then
661 <      Result := Result + LineEnding;
659 <    Result := Result + 'Engine Code: ' + IntToStr(GetIBErrorCode) + ' ';
660 <  end;
660 >    if (ShowSQLCode in IBDataBaseErrorMessages) then
661 >      Result := Result + 'SQLCODE: ' + IntToStr(Getsqlcode); {do not localize}
662  
663 <  if (ShowSQLMessage in IBDataBaseErrorMessages) then
664 <    Result := Result + GetSQLMessage;
663 >    if (ShowSQLMessage in IBDataBaseErrorMessages) then
664 >    begin
665 >      if ShowSQLCode in IBDataBaseErrorMessages then
666 >        Result := Result + LineEnding;
667 >      Result := Result + GetSQLMessage;
668 >    end;
669 >  end;
670  
671    if (ShowIBMessage in IBDataBaseErrorMessages) then
672    begin
673 <    if ShowSQLMessage in IBDataBaseErrorMessages then
673 >    if Result <> FPrefix then
674        Result := Result + LineEnding;
675 <    Result := Result + GetIBMessage;
675 >    Result := Result + 'Engine Code: ' + IntToStr(GetIBErrorCode) + LineEnding + GetIBMessage;
676    end;
677    if (Result <> '') and (Result[Length(Result)] = '.') then
678      Delete(Result, Length(Result), 1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines