Stuart Clennett 15 Posted December 11, 2018 Hi Andrea, I am trying to add a new datamodule to my MARS server that supports the FireDAC functions but the resource is not being included in the server app along with the others. I have inspected your "FireDAC Basic Demo" and I did the following: • Added MARS.Data.FireDAC.DataModule to my server project from the MARS\Source directory • Created a new DataModule by inheriting from that unit • Added the MARS units to the uses clause, as per your demo • Added the Path attribute • Added the Initialization section to add the datamodule to the MARSResourceRegistry.Instance However, on running the server I cannot see the resource listed in the treeview and it is not recognised when I try to access through the client. Is there something I have missed? Thanks The full datamodule source code is here: unit server.fddata; interface uses System.SysUtils, System.Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.IB, FireDAC.Phys.IBDef, FireDAC.VCLUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client , MARS.Data.FireDAC.DataModule , MARS.Core.Attributes , MARS.Core.URL , MARS.Core.Token ; type [Path('/data')] TFDData = class(TMARSFDDataModuleResource) EmployeeConnection: TFDConnection; EmployeeTable: TFDQuery; private public end; implementation {%CLASSGROUP 'Vcl.Controls.TControl'} uses MARS.Core.Registry; {$R *.dfm} Initialization TMARSResourceRegistry.Instance.RegisterResource<TFDData>; end. Share this post Link to post
Bjørn Larsen 3 Posted December 11, 2018 Hi, Have you made sure that your unit is listed under uses and included in the filter that is specified in the AddApplication procedure? FEngine.AddApplication('DefaultApp', '/default', [ 'Server.*']); -- Bjørn 1 1 Share this post Link to post
Stuart Clennett 15 Posted December 11, 2018 Hi Bjørn, Yes, that was the missing piece of the jigsaw. I needed to add the server.fddata unit to the uses clause of server.ignite, and also the AddApplication filter was 'server.resources.*' which I have changed to 'server.*' My data resource appears in the list now. Many thanks 1 Share this post Link to post