Locate with FireDac FDTable

edited 7:57PM in FastReport VCL
I'm using the latest version of FastReport FMX with Rio 10.3. I'm converting my project from IBX components to FireDAC. All the FastReport FireDac components seem to compile and install properly. I connect to the database and the FD components appear on the form data tab. With IBX I made extensive use of the Table1.Locate command throughout my source. When I replaced the tables with the FD equivalent, I get an error on Table1.Locate.

Is this not supported with FastReports and FireDac? Or is there something else I need to do?

thank you

Comments

  • gpigpi
    edited 7:57PM
    Try to modify FMX.frxFDRTTI.pas
    function TfrxFDFunctions.GetProp(Instance: TObject; ClassType: TClass;
      const PropName: String): Variant;
    begin
      Result := 0;
    
      if ClassType = TFDQuery then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDQuery(Instance).ParamCount;
      end
      else if ClassType = TFDStoredProc then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDStoredProc(Instance).ParamCount;
      end
      else if ClassType = TfrxFDDatabase then begin
        if PropName = 'DATABASE' then
          Result := Integer(TfrxFDDatabase(Instance).Database);
      end
      else if ClassType = TfrxFDTable then begin
        if PropName = 'TABLE' then
          Result := Integer(TfrxFDTable(Instance).Table);
      end
      else if ClassType = TfrxFDQuery then begin
        if PropName = 'QUERY' then
          Result := Integer(TfrxFDQuery(Instance).Query);
      end
      else if ClassType = TfrxFDStoredProc then begin
        if PropName = 'STOREDPROC' then
          Result := Integer(TfrxFDStoredProc(Instance).StoredProc);
      end;
    end;
    
  • edited 7:57PM
    gpi wrote: »
    Try to modify FMX.frxFDRTTI.pas
    function TfrxFDFunctions.GetProp(Instance: TObject; ClassType: TClass;
      const PropName: String): Variant;
    begin
      Result := 0;
    
      if ClassType = TFDQuery then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDQuery(Instance).ParamCount;
      end
      else if ClassType = TFDStoredProc then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDStoredProc(Instance).ParamCount;
      end
      else if ClassType = TfrxFDDatabase then begin
        if PropName = 'DATABASE' then
          Result := Integer(TfrxFDDatabase(Instance).Database);
      end
      else if ClassType = TfrxFDTable then begin
        if PropName = 'TABLE' then
          Result := Integer(TfrxFDTable(Instance).Table);
      end
      else if ClassType = TfrxFDQuery then begin
        if PropName = 'QUERY' then
          Result := Integer(TfrxFDQuery(Instance).Query);
      end
      else if ClassType = TfrxFDStoredProc then begin
        if PropName = 'STOREDPROC' then
          Result := Integer(TfrxFDStoredProc(Instance).StoredProc);
      end;
    end;
    


    Finally able to try this but still get error: "Unknown type TfrxFDTable" on the mytable.Locate command
  • gpigpi
    edited 7:57PM
    Try mytable.Table.Locate
  • edited 7:57PM
    gpi wrote: »
    Try mytable.Table.Locate

    still same error "Unknown Type: TFrxFDTable" I recompiled all after changing the code, the table displays in the data tree with all fields

Leave a Comment