RemObjects 8.3 with Lazarus / Parameter Problem after Version update

Hi

Since i updated the Version to the new Version in Lazarus it look like there is a Problem with to use of Parameter:
Until now i had this code and it worked like expected:

procedure TDM_hotel.print_current(Sender: TObject);
var
  param_ar1, param_ar2, param_ar3, param_ar4, param_ar5:DataParameterArray;
  par_ar1, par_ar2, par_ar3, par_ar4, par_ar5:DataParameter;
begin
  custom_field := frm_hotel.ID.Field.DisplayText;
  /// Just for Debuging // The ID is read correctly from the Database

  param_ar1 := DataParameterArray.Create;
  par_ar1 := param_ar1.Add;
  par_ar1.Name := UTF8Encode('C_NO');
  par_ar1.Value := frm_hotel.C_NO.Field.DisplayText;

  param_ar2 := DataParameterArray.Create;
  par_ar2 := param_ar2.Add;
  par_ar2.Name := UTF8Encode('ID');
  par_ar2.Value := frm_hotel.ID.Field.DisplayText;

  param_ar3 := DataParameterArray.Create;
  par_ar3 := param_ar3.Add;
  par_ar3.Name := UTF8Encode('ID_AREA');
  par_ar3.Value := frm_hotel.ID.Field.DisplayText;

  param_ar4 := DataParameterArray.Create;
  par_ar4 := param_ar4.Add;
  par_ar4.Name := UTF8Encode('ID_AREA');
  par_ar4.Value := frm_hotel.ID.Field.DisplayText;

  param_ar5 := DataParameterArray.Create;
  par_ar5 := param_ar5.Add;
  par_ar5.Name := UTF8Encode('STAT_DEL');
  par_ar5.Value := 0;

  DM.RemoteDataAdapter.FillWithDASql(
    [DM_reports.tbl_rep_camps,
     DM_reports.tbl_rep_default,
     DM_reports.tbl_rep_default_c,
     DM_reports.tbl_rep_default_d,
     DM_reports.tbl_rep_default_dd],
     ['SELECT * FROM CAMPS '+
                'WHERE ( C_NO = :C_NO)',
      'SELECT * FROM HOTEL '+
                'WHERE ( ID = :ID) ',
      'SELECT * FROM HOTEL_C '+
                'WHERE ( ID_AREA = :ID_AREA AND STAT_DEL = 0 ) '+
                'ORDER BY C_NAME',
      'SELECT * FROM HOTEL_D '+
                'WHERE ( ID_AREA = :ID_AREA AND STAT_DEL = 0 ) '+
                'ORDER BY D_DATE DESC',
      'SELECT * FROM HOTEL_DD '+
                'WHERE ( STAT_DEL = :STAT_DEL) '+
                'ORDER BY BIBLE_TYPE'],
    [param_ar1,
     param_ar2,
     param_ar3,
     param_ar4,
     param_ar5]);

  report_file := 'report_dist.fr3';
  report_var_name := '''' + frm_hotel.Caption+ '''';
  DM_reports.print_dist(Sender);
end;                  

Now the Code does not filter.

Thanks for a Tip.
Manfred

Hi again…
Has nobody realized this behavior?

Shalom
Manfred

it could be here.
validate that you correctly specify ServerName in RDA or RemoteService

Hi EvgenyK
Thanks for the Replay.
I get a result but it is not filtered. I used this ( worked before ) to get only 1 Reccord. frm_hotel.ID.Field.DisplayText;
Is the ID ( GUID ) from the current Data displayed in the App.

param_ar2 := DataParameterArray.Create;
  par_ar2 := param_ar2.Add;
  par_ar2.Name := UTF8Encode('ID');
  par_ar2.Value := frm_hotel.ID.Field.DisplayText;

Instead i get all records…

I can’t reproduce this behavior with DASQL sample and DA 8.3.
Can you create a simple testcase that reproduces this case, pls?

Did a simple test-case but i could not reproduce the Problem…
I look in the moment into your suggestion:

it could be here.
validate that you correctly specify ServerName in RDA or RemoteService

found also this thread:

For testing purpose i deleted this:

remote service, channel, message and streamer.
I am not quite sure how to adapt my connection setup:

Now i tried this:

  RemoteDataAdapter := TDARemoteDataAdapter.Create(nil);
  RemoteDataAdapter.DataServiceName := 'DataService';
  RemoteDataAdapter.TargetURL := sync_server;
  RemoteDataAdapter.LoginServiceName := 'LoginService';  //optionaly
  RemoteDataAdapter.LoginString := Relativity_Connection_String;                   //optionaly
  RemoteDataAdapter.RemoteService.           // how i define this??

RemoteDataAdapter.RemoteService. // how i define this??
In my Testcase this was not needed but in my Application i get the Error RemoteDataAdapter: RemoteService must be assigned.

You don’t need to use RemoteDataAdapter.RemoteService if new properties (DataServiceName &Co) are used.
Review our samples:

  lRemoteDataAdapter := TDARemoteDataAdapter.Create(nil);
  lRemoteDataAdapter.DataServiceName := 'DataService';
  lRemoteDataAdapter.LoginServiceName := 'LoginService';
  lRemoteDataAdapter.LoginString := connString;
  lRemoteDataAdapter.TargetURL := ServerURL;

  lTable := TDAMemDataTable.Create(nil);
  lTable.RemoteDataAdapter := lRemoteDataAdapter;
  lTable.LogicalName := 'MyData';

  lRemoteDataAdapter.FillWithDASql(lTable,DASQL1);

Found the “Problem” ( was a Programmer Problem… :disappointed: )

Had almost all Dataset as Master-Detail configured.
But i did change this in the end…

DM.RemoteDataAdapter.FillWithDASql(
    [DM_reports.tbl_rep_camps,
     DM_reports.tbl_rep_default,
     DM_reports.tbl_rep_default_c,
     DM_reports.tbl_rep_default_d,
     DM_reports.tbl_rep_default_dd],

DM_reports.tbl_rep_camps
  is the master of 
DM_reports.tbl_rep_default
  is the master of 
DM_reports.tbl_rep_default_d
  is the master of 
DM_reports.tbl_rep_default_dd

before i had the same without DM_reports.tbl_rep_camps mastersetting of the rest.
This seems to cause the Probelm… :grin:

The lRemoteDataAdapter Setings are working now.

Is there a difference in Performance or Something else when using

lRemoteDataAdapter.FillWithDASql(lTable,DASQL1);

insted of

DM.RemoteDataAdapter.FillWithDASql(
        [DM_reports.tbl_rep_camps],
         ['SELECT * FROM CAMPS '+
                    'WHERE ( C_NO = :C_NO)''],
        [param_ar1]);

Shalom
Manfred

I think, 1st request will be executes a ише faster because server shouldn’t assign it doesn’t contain params.
but you can compare performance in your case