限制clientdataset列和大小

时间:2010-01-18 18:55:08

标签: delphi

客户端数据集可以拥有的列数是否有限制,并且列的大小是否有限制?

我们有一个应用程序从xml文件加载客户端数据集(它不是磁盘上的文件,而是加载的内存中的xml块),我们发现如果我们将其中一个列的宽度设置为1000,然后我们会得到一些模糊的访问冲突(有时应用程序只会挂起)。

JD。

聚苯乙烯。到目前为止,我记得我们仍在使用delphi 2006附带的客户端数据集。

好的,有些代码:

我们有一个xml数据块,格式如下: string xmlDataSet =

<METADATA>
    <FIELDS>
        <FIELD attrname="f:CNAME" fieldtype="string" width="50"/>
        <FIELD attrname="f:CTITL" fieldtype="string" width="500"/>
        <FIELD attrname="f:ID" fieldtype="string" width="250"/>
        <FIELD attrname="f:CREDT" fieldtype="string" width="250"/>
        <FIELD attrname="f:HEADT" fieldtype="string" width="500"/>
        <FIELD attrname="f:BODYT" fieldtype="string" width="500"/>
        <FIELD attrname="f:DATE1" fieldtype="string" width="500"/>
        <FIELD attrname="f:TIME1" fieldtype="string" width="500"/>
        <FIELD attrname="f:DATE2" fieldtype="string" width="500"/>
        <FIELD attrname="f:TIME2" fieldtype="string" width="500"/>
        <FIELD attrname="f:IMG_1" fieldtype="string" width="500"/>
        <FIELD attrname="f:IMG_2" fieldtype="string" width="500"/>
        <FIELD attrname="f:IMG_3" fieldtype="string" width="500"/>
        <FIELD attrname="f:VID_1" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_A" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_B" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_C" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_D" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_E" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_F" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_G" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_H" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_I" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_J" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_K" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_L" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_M" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_N" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_O" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_P" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_Q" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_R" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_S" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_T" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_U" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_V" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_W" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_X" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_Y" fieldtype="string" width="500"/>
        <FIELD attrname="f:FLD_Z" fieldtype="string" width="500"/>
    </FIELDS>
</METADATA>
<ROWDATA>
    <ROW f:DATE2="" f:TIME2="" f:IMG_2="" f:IMG_3="" f:VID_1="" f:FLD_A="" f:FLD_B="" f:FLD_C="" f:FLD_D="" f:FLD_E="" f:FLD_F="" f:FLD_G="" f:FLD_H="" f:FLD_I="" f:FLD_J="" f:FLD_K="" f:FLD_L="" f:FLD_M="" f:FLD_N="" f:FLD_O="" f:FLD_P="" f:FLD_Q="" f:FLD_R="" f:FLD_S="" f:FLD_T="" f:FLD_U="" f:FLD_V="" f:FLD_W="" f:FLD_X="" f:FLD_Y="" f:FLD_Z="" f:CNAME="YahooNewsTopStories" f:CTITL="Yahoo! News: Top Stories" f:ID="ap/20100119/cb_haiti_earthquake" f:HEADT="Haiti chaos hampers aid delivery; death toll rises (AP)" f:BODYT="AP - Relief workers say pockets of violence in Haiti's devastated capital are hindering a slow increase in much-needed aid delivery, and some residents have banded together to protect the few possessions they have left." f:IMG_1="http://d.yimg.com/a/p/ap/20100118/capt.cb4c93423c284ca985dd02fd38d283e4.haiti_earthquake_xgb107.jpg?x=130&amp;y=82&amp;q=85&amp;sig=gRxfiZPe6KlqoVNPtadFzQ--" flab:DATE1="Publication Date" f:CREDT="(AP)" f:TIME1="13:03:59" f:DATE1="mardi 19 janvier 2010"/>
    <ROW f:DATE2="" f:TIME2="" f:IMG_2="" f:IMG_3="" f:VID_1="" f:FLD_A="" f:FLD_B="" f:FLD_C="" f:FLD_D="" f:FLD_E="" f:FLD_F="" f:FLD_G="" f:FLD_H="" f:FLD_I="" f:FLD_J="" f:FLD_K="" f:FLD_L="" f:FLD_M="" f:FLD_N="" f:FLD_O="" f:FLD_P="" f:FLD_Q="" f:FLD_R="" f:FLD_S="" f:FLD_T="" f:FLD_U="" f:FLD_V="" f:FLD_W="" f:FLD_X="" f:FLD_Y="" f:FLD_Z="" f:CNAME="YahooNewsTopStories" f:CTITL="Yahoo! News: Top Stories" f:ID="ap/20100119/us_marriage_economics" f:HEADT="Report: More men get economic boost from marriage (AP)" f:BODYT="AP - Historically, marriage was the surest route to financial security for women. Nowadays it's men who are increasingly getting the biggest economic boost from tying the knot, according to a new analysis of census data." f:IMG_1="" flab:DATE1="Publication Date" f:CREDT="" f:TIME1="13:03:59" f:DATE1="mardi 19 janvier 2010"/> etc...LOTS MORE ROWS.

在内存中使用此xml块,我们按如下方式加载:

FClientDataSet:= TClientDataSet.Create(nil); TransformedXSLTStream:= TStringStream.Create(xmlDataSet); (从上面) ClientDataSet.LoadFromStream(TransformedXSLTStream); TransformedXSLTStream.Free; ClientDataSet.First;

现在,如果我将宽度设置为1000以上,那么我会在LoadStream上获得访问冲突(读取地址xxx等)。

1 个答案:

答案 0 :(得分:1)

我的猜测是内存相关或硬编码限制。如果跟踪组件,您应该能够轻松找到异常。我会从loadstream开始。您也可以尝试使用您知道干净的测试数据。我在解析XML和其他类似格式时遇到过这种情况,其中数据具有“无效”字符,这会导致应用程序崩溃。 Ansi / unicode也为我做了一件简单的文本文件。

相关问题