views:

338

answers:

2

I've got a bunch of data loaded into a TClientDataset, representing an array of complex objects. But when I try to run

Dataset.SaveToFile('c:\test.xml', dfXMLUTF8);

it doesn't like it:

Project testing.exe raised exception class EDBClient with message 'Fieldtype not supported for XML.'.

This is a lot less useful than it should be, for two reasons. First off, it doesn't say which field or which field type isn't supported, and second, the actual saving is taking place inside a black-box DLL.

The only field types I'm using in this dataset are integers, strings, booleans, and a few TArrayFields that hold arrays of integer fields. Nothing I'd expect to be all that difficult to serialize. Anyone have any idea why this isn't working?

+1  A: 

Is everything saved or just some fields? Maybe for example TArrayFields are throwing an exception? Try removing different fieldtypes one-by-one and see when things start working.

Riho
A: 

Wild guess is that array fields are not supported in XML export, but you should check.

Go to Project options->Compiler and turn on "Use debug DCUs". Rebuild.

Set breakpoint on your SaveToFile() call. Run.

Then you can step into VCL source and try to hunt for what is unsupported.

dmajkic
Debug DCUs are already on. They can't trace into the calls to midas.dll, though.
Mason Wheeler