TSQLQuery SaveToFile using dfXMLUTF8 & dfXML options give me an empty file lazarus / 16-Databases ---------------------------------------------------------------------- JD · 2015-04-01 23:09 Hi there everyone, Is there a problem with TSQLQuery's SaveToFile method? When I save a dataset to disk using SaveToFile('test.xml'), I get a file with data inside it. But when I change it to SaveToFile('test.xml', dfXMLUTF8) or SaveToFile('test.xml', dfXML), I get an empty file. HAs anyone had a similar experience on this forum? Thanks, JD ---------------------------------------------------------------------- LacaK · 2015-04-02 09:50 SaveToFile without 2nd parameter uses default dfBinary format (so it is not XML) You must put in your uses clause: uses xmldatapacketreader then this unit will register datapacket reader/writer for dfXML (for dfXMLUTF8 there is no supplied unit so this format is not supported ... You should get exception) ---------------------------------------------------------------------- JD · 2015-04-03 08:30 Quote from: LacaK on April 02, 2015, 11:50:32 amSaveToFile without 2nd parameter uses default dfBinary format (so it is not XML) You must put in your uses clause: uses xmldatapacketreader then this unit will register datapacket reader/writer for dfXML (for dfXMLUTF8 there is no supplied unit so this format is not supported ... You should get exception) Thanks LacaK. It worked just like you suggested.