XData and NexusDB

Hi,

I am new to this. I have created a new project using the TMS XData Server Group Wizard. I am then adding the relevant nexusdb components to the ConnectionModule and setting the properties as normal and then setting the Connection.Session. I can then select an aliasname and connect and run the xdata server which seems to run fine.

On the client side at design time  I can then set  the xdatawebconnection connected property to true. but when I run the project I get the error message:

ERROR XDataConnectionError: Error connecting to XData server | $class::[object Object]
fMessage::XDataConnectionError: Error connecting to XData server fHelpContext::0 at [0:0]

I am not trying to do anything else at this stage. Any help  greatly appreciated.

Thanks,

Ken

Hello Ken,

Please check the browser console for a more detailed error message. My guess is that you are running into CORS issue. Use the following code in server to solve it, if that's the case (reference: http://www.tmssoftware.biz/business/sparkle/doc/web/cors-middleware.html).



uses {...}, Sparkle.Middleware.Cors;
{...}
  Module.AddMiddleware(TCorsMiddleware.Create);

Wagner R. Landgraf2018-10-22 14:05:56

Thanks Wagner. That worked but I am struggling as to how to get data out of a specific table!

Ok. I've worked out that I need to use the TMS Data Modeler and do a TMS Aurelius export and add the unit created to my Server. Might be a good idea to have a section on this in the documentation.

I can now select the EntitySetName for themTXDataWebDataSet and populate an FNC Grid using a TMSFNCGridDatabaseAdapter.

Can I use SQL in any way to select the rows that appear?
SQL on the client is not possible - you will have to use filters or use server side service operations: 

http://www.tmssoftware.biz/business/xdata/doc/web/requesting_entity_list_client.html 
and
http://www.tmssoftware.biz/business/xdata/doc/web/invoking_service_operations_client.html 

Thanks. That makes it very difficult to convert existing applications!

It looks like you had already assumed you would have to rewrite your forms. So what exactly you want to "convert", given you are already building up new forms?

I was hoping to re-use the SQL.

That would make your SQL available for everyone to read at client side. And if your server allows the client to choose arbitrary SQL to be executed, some user could just change the SQL to something else (even a DELETE statement) and execute it.

It's new architecture, your server rules your business rules, and TMS Web Core rules the frontend UI.