Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8849863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:45:53+00:00 2026-06-14T12:45:53+00:00

I’ve just installed Delphi 7 for Personal Use and I’m trying to convert a

  • 0

I’ve just installed Delphi 7 for Personal Use and I’m trying to convert a delphi ClientDataSet file to dfXMLUTF8. All I really need is the xml structure. This site suggests that running 4 lines of code will generate the output I desire. Note however that My file is .cds, not .dat as in the example. I don’t know if this makes a difference.

ClientDataSet1.Active := false;
ClientDataSet1.CreateDataSet;
ClientDataSet1.LoadFromFile('MyBinaryFile.dat');
ClientDataSet1.SaveToFile('MyXMLFile.XML', dfXMLUTF8);

I’m receiving errors and since I’ve never really used Delphi before and I’m hoping somebody who knows what they are doing could just post the very short xml structure for me. Here’s the file(486 bytes) I’m working with. I will award correct answer to the first poster with full dfXMLUTF8 output. Thanks!

Update:

Okay I just started the project from scratch and I think I have it somewhat setup. I have added uses DBClient;, var ClientDataSet1: TClientDataSet, and lastly the procedure:

ClientDataSet1.LoadFromFile('C:\Documents and Settings\XPMUser\Desktop\DelphiCDS\Master.cds');
  ClientDataSet1.SaveToFile('C:\Documents and Settings\XPMUser\Desktop\DelphiCDS\output.XML', dfXMLUTF8);

It throws the following error:

Access violation at address 004588B6 in module ‘Project.exe’. Read of
address 00000000.

Update2:

Here’s what I ended up with:

unit Script3;

interface

uses
  Forms, DBClient;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;
  CDS: TClientDataSet;

implementation
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  CDS := TClientDataSet.Create(nil);
  try
    CDS.LoadFromFile('.\input.cds');
    CDS.SaveToFile('.\output.xml', dfXMLUTF8);
  finally
    CDS.Free;
  end;
end;

end.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:45:54+00:00Added an answer on June 14, 2026 at 12:45 pm

    You’re doing much more than you have to in order to accomplish the conversion. With the presumption that MyBinaryFile.dat is actually a binary format Delphi TClientDataSet file, these two lines of code (with no additional setup) will work:

    ClientDataSet1.LoadFromFile('D:\Temp\MyBinaryFile.dat');
    ClientDataSet1.SaveToFile('D:\Temp\MyXMLFile.xml', dfXMLUTF8);
    

    Without knowing more about what your MyBinaryFile.dat is, and no information about the errors you’re getting, it’s pretty difficult to provide more information. Tested and working with the standard animals.cds in Delphi 7 (from C:\Program Files\Common Files\Borland Shared\Data in a standard D7 install on a Windowx XP virtual machine).

    It seems, from your comment below, that the actual problem you’re having is a compiler error about an unidentified identifier TClientDataSet when you try and create it in code. If you have a high enough SKU for Delphi 7 that includes TClientDataSet (IIRC, Professional and higher), you can just add DBClient to your uses clause:

    implementation
    
    uses 
      DBClient;
    
    procedure TForm1.FormShow(Sender: TObject);
    var
      CDS: TClientDataSet;
    begin
      CDS := TClientDataSet.Create(nil);
      try
        CDS.LoadFromFile('MyBinaryFile.dat');
        CDS.SaveToFile('MyXMLFile.xml', dfXMLUTF8);
      finally
        CDS.Free;
      end;
    end;
    

    Or, better yet, if you’re creating a VCL Forms application, just drop a TClientDataSet on your form; you’ll find it on the DataAccess tab in the component palette.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my XML file chapters tag has more chapter tag.i need to display chapters
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I am trying to render a haml file in a javascript response like so:
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm parsing an XML file, the creators of it stuck in a bunch social

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.