PHP joins ClientSataDet CDS file

I have an empty installation of Delphi ClientDataSet CDS files with all the columns / headers / data types that I need. I want to use PHP to add an associative array to CDS strings. Is it possible?

An array can be simple:

{ 1: {Name:Captain, Phone:18001234567} 2: {Name:Jack, Phone:18009876543} 3: {Name:Sparrow, Phone:18887892345} } 

I chose PHP because I know the language and my web server is the shared-linux host. Basically, I can't run Delphi here. I am open to other options that may work in this environment. Thanks!

EDIT:

See comments on this post for my permission.

+3
source share
1 answer

I recommend that you do not write directly to cds files.

Instead, you can use plain xml for both applications (PHP and Delphi) and on the delphi side, which you load and save using XML Transformation with TXmlTransformProvider, and on the PHP side you just write it in XML, as always.

Take a look here on how to configure on delphi.

- UPDATE

If you really need to change the direct cds file (using the xml format), you can simply add a new one to the cds file, given that the cds format is xml:

 <?xml version="1.0" standalone="yes"?> <DATAPACKET Version="2.0"> <METADATA> <FIELDS> <FIELD attrname="Name" fieldtype="string" WIDTH="24"/> <FIELD attrname="Capital" fieldtype="string" WIDTH="24"/> </FIELDS> <PARAMS DEFAULT_ORDER="1" PRIMARY_KEY="1" LCID="2057"/> </METADATA> <ROWDATA> <ROW Name="Argentina" Capital="Buenos Aires"/> <ROW Name="Bolivia" Capital="La Paz"/> <ROW Name="Brazil" Capital="Brasilia"/> <ROW Name="Canada" Capital="Ottawa"/> <ROW Name="United States of America" Capital="Washington"/> //Add your new ROW tag here with your data </ROWDATA> </DATAPACKET> 
0
source

Source: https://habr.com/ru/post/1415226/


All Articles