Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]



Permlink Replies: 6 - Last Post: Mar 6, 2017 10:40 PM Last Post By: Dmitry Arefiev
Pablo Romero

Posts: 21
Registered: 9/28/00
About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2015 2:23 PM
Hi fellas:

I have a simple question:

I have an XML file obteined from a TClientDataSet. I want to read it
into a TFDMemTable, like this...

AssignFile(myXmlFile, 'Test.XML');
Reset(myXmlFile);
while not Eof(myXmlFile) do
begin
ReadLn(myXmlFile, text );
MyXMlBuf := MyXMlBuf + text;
end;
CloseFile(myXmlFile);

// so far, so good: myxmlBuf is ok.
MyFDMemTable.XMLData := MyXMLBuf; //<---- error!

It shows this error

"Project MyService.exe raised exception class EFDException with message
'[FireDAC][Stan]-712. Cannot read [Manager] object..."

I put inside my project, the "FireDAC.Stan.StorageXML" in the units.

What am I doing wrong? I'm using Delphi XE7

Regards
Pablo Romero
Cordoba, Argentina
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 15, 2015 12:17 AM   in response to: Pablo Romero in response to: Pablo Romero
FireDAC does not support TClientDataSet XML format.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Pablo Romero

Posts: 21
Registered: 9/28/00
Re: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 15, 2015 4:37 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
El 15/04/2015 a las 04:17 a.m., Dmitry Arefiev escibió:
FireDAC does not support TClientDataSet XML format.

It's a bad new. Ok: Our project is about a program to communicate 2
points, using TClientDataSets. It's possible to replace TClientDataSet
for TFDMemTable and using their XMLData property?

Regards
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 15, 2015 5:08 AM   in response to: Pablo Romero in response to: Pablo Romero
It's possible to replace TClientDataSet for TFDMemTable and using their XMLData property?

Yes, it is. TFDMemTable tries to copy API and behaviour of TClientDataSet.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Bernd Linde

Posts: 17
Registered: 8/2/14
Re: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 15, 2015 5:14 AM   in response to: Pablo Romero in response to: Pablo Romero
{quote:title=Pablo Romero Romero wrote:}>
It's a bad new. Ok: Our project is about a program to communicate 2
points, using TClientDataSets. It's possible to replace TClientDataSet
for TFDMemTable and using their XMLData property?

Regards

You could try to use the CopyDataSet method on the TFDMemTable object to get the data from the TClientDataset into your FDMemTable.
It might be a bit more resource intensive (depending on the size of the data), but it is a work around.

Alternatively, if you control both sides of the communication points, replace both side's TClientDataSets with TFDMemTable and generate the XML from there (which you then can import into the other sides FDMemTable)

http://docwiki.embarcadero.com/Libraries/XE7/en/FireDAC.Comp.DataSet.TFDDataSet.CopyDataSet
Trevor Cooper

Posts: 45
Registered: 10/7/10
Re: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 6, 2017 8:41 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry,

What is it about an .xml created by a TClientDataSet that cannot be handled by TFDMemTable.LoadFromFile?

I read that TFDMemTable.XMLData may be an alternative way to read in a TClientDataSet .xml. But I can't see any information in the help or in the DocWiki that describes what to do with this property. Can you help?

Thanks

Trevor Cooper
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: About TDMemTable with XML from TClientDataSet - [FireDAC][Stan]-712. Cannot read [Manager]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 6, 2017 10:40 PM   in response to: Trevor Cooper in response to: Trevor Cooper
Once again, FireDAC does not support TClientDataSet XML format.
In theory, you can develop XSLT to transform TClientDataSet XML to FireDAC XML or backward.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02