Lazarus 2.0.10 Compile Problem Data Abstract for Delphi

Hi
There seems to be a Problem with compiling within Lazarus:

Version: Data Abstract for Delphi - 10.0.0.1481
and Data Abstract for Delphi, Server Edition - 10.0.0.1483

uDACore.pas

Error:
uDACore.pas(1254,13) Error: Incompatible types: got “AnsiString” expected “TBytes”

function TDABaseField.GetAsBlob: TBlobData;
    begin
      {$IFDEF Delphi2009UP}
      Result := GetAsBytes;
      {$ELSE}
      Result := AnsiBytesToString(GetAsBytes);
      {$ENDIF}
    end;         

and
uDACore.pas(1316,37) Error: Incompatible type for arg no. 1: Got “TBytes”, expected “AnsiString”

procedure TDABaseField.SetAsBlob(const Value: TBlobData);
begin
  {$IFDEF Delphi2009UP}
  SetAsBytes(Value);
  {$ELSE}
  SetAsBytes(StringToAnsiBytes(Value));
  {$ENDIF}
end;     

Thank you in advance for a Solution.
Manfred

Thanks, DonaldShimoda
Did Adapt like you said, now it look like this:

function TDABaseField.GetAsBlob: TBlobData;
begin
  {$IFDEF Delphi2009UP}
  Result := GetAsBytes;
//  {$ELSE}
//  Result := AnsiBytesToString(GetAsBytes);
//  {$ENDIF}
//end;
      {$ELSE}
      {$IFDEF FPC}
              Result := GetAsBytes;
      {$ELSE}
             Result := AnsiBytesToString(GetAsBytes);
      {$ENDIF}
      {$ENDIF}
end;     

procedure TDABaseField.SetAsBlob(const Value: TBlobData);
begin
  {$IFDEF Delphi2009UP}
  SetAsBytes(Value);
  //{$ELSE}
  //SetAsBytes(StringToAnsiBytes(Value));
  //{$ENDIF}
  {$ELSE}
  {$IFDEF FPC}
          SetAsBytes(Value);
  {$ELSE}
         SetAsBytes(StringToAnsiBytes(Value));
  {$ENDIF}
  {$ENDIF}
end; 

There seems to be more Problems…
There is also in uDAFields.pas
uDAFields.pas(1295,33) Error: Incompatible types: got “AnsiString” expected “TBytes”

function TDACustomField.GetAsBlob: TBlobData;
begin
  {$IFDEF Delphi2009UP}
  Result := fField.AsBytes;
  {$ELSE}
  if fField is TBlobField then
    result := TBlobField(fField).Value
  else begin
    Result := fField.AsString;
  end;
  {$ENDIF}
end;

Thanks, logged as bugs://84660

bugs://84660 got closed with status fixed.

Hi,

  • add these lines to DataAbstract.inc:
{$IFDEF DELPHI2009UP}
  {$DEFINE DELPHI2009UP_FPC}
{$ENDIF}

{$IFDEF FPC}
  {$DEFINE DELPHI2009UP_FPC}
{$ENDIF}
  • update uDACore.pas:
function TDABaseField.GetAsBlob: TBlobData;
begin
  {$IFDEF DELPHI2009UP_FPC} //changed

procedure TDABaseField.SetAsBlob(const Value: TBlobData);
begin
  {$IFDEF DELPHI2009UP_FPC} //changed
  • update uDAFields.pas as
function TDACustomField.GetAsBlob: TBlobData;
begin
  {$IFDEF DELPHI2009UP_FPC}  //changed

procedure TDACustomField.SetAsBlob(const Value: TBlobData);
begin
  {$IFDEF DELPHI2009UP_FPC} //changed

:grin: Works just fine Thanks
Shalom Manfred