PHP追加到的ClientDataSet CDS文件 [英] PHP append to ClientDataSet CDS File

查看:291
本文介绍了PHP追加到的ClientDataSet CDS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个空的德尔福的ClientDataSet CDS文件设置的所有列/头/数据类型,我需要。我想用PHP要追加一个关联数组CDS行。这可能吗?

I have an empty Delphi ClientDataSet CDS File setup with all the Columns/Headers/Datatypes that I need. I want to use PHP to append an associative array into CDS rows. Is this possible?

该阵列可以仅仅是:

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

我选择PHP,因为我精通的语言和我的Web服务器是一个共享Linux主机。基本上,我不能在这里运行德尔福。我愿意,可以在这种环境下工作的其他选项。谢谢!

I've selected PHP because I'm proficient with the language and my web server is a shared-linux host. Basically I cannot run Delphi here. I'm open to other options that could work in this environment. Thanks!

编辑:

请参阅这个帖子上的评论对我的决心。

See the comments on this post for my resolution.

推荐答案

我建议你不要直接刻写CD文件。

I recommend you to not write direct to the cds files.

相反,你可以使用这两个应用程序的通用XML(PHP和Delphi)和德尔福侧加载并使用XML转换用的 TXmlTransformProvider 并在PHP端你只是把它写的XML,你总是这样。

Instead you can use a common xml for both applications (PHP and Delphi) and on the delphi side you load and save it using XML Transformation with TXmlTransformProvider and on the PHP side you just write it to the XML as you always do.

看看<一个href=\"http://docwiki.embarcadero.com/RADStudio/en/Using_an_XML_Document_as_the_Source_for_a_Provider\"相对=nofollow>此处如何德尔福设置。

- 更新

如果你真的需要直接改变CDS文件(使用XML格式),您可以只需添加一个新的CDS文件考虑到CDS格式是XML这样的:

If you realy need to change direct the cds file (using xml format) you can just add a new to the cds file considering the cds format is xml like this:

<?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>

这篇关于PHP追加到的ClientDataSet CDS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆