TClientdataset 参数无效错误

发布于 2024-07-12 13:09:32 字数 78 浏览 15 评论 0原文

在 TClientDataSet 组件中调用 CreateDataSet 方法时出现“无效参数错误”的原因是什么? 是什么原因导致这个错误。

What is the reason for getting an 'invalid parameter error' when calling the CreateDataSet method in a TClientDataSet component. What causes this error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

鸩远一方 2024-07-19 13:09:32

当您有 ftString 数据类型字段且其大小为零或未提供时,也可能会导致此类错误。 我尝试为数据集创建 fieldef,但尚未指定字符串字段的大小。 我最终遇到了同样的错误。

When you have an ftString datatype field and the size of that is zero or not provided, then it also may cause this kind of error. I have tried creating the fieldefs for the dataset and haven't specified the size for the string field. I ended up with the same error.

伏妖词 2024-07-19 13:09:32

Riaan,

您使用 ftGuid 字段吗? 如果是这样,您必须手动将字段的大小设置为 38。

问候,
利文

Riaan,

are you using ftGuid fields? If so, you have to manually set the size of the field to 38.

regards,
Lieven

我为君王 2024-07-19 13:09:32

Lieven 正确地指出,在创建(使用 CreateDataSet)与其关联的 ClientDataSet 之前,某些 TField 具有不同的需求(就其属性而言)。 但 TGuid 字段并不是唯一的。

如果您无法确定哪个字段导致了问题,请注释掉除一个字段类型(例如 TStringField)之外的所有字段类型,然后尝试创建 ClientDataSet。 如果第一组没有造成任何问题,则继续进行下一组。 它可以像 BDC(二进制编码的十进制)字段一样简单,也可以是更奇特的东西。

一旦找到导致错误的字段类型,请使用帮助并确保仅包含对该字段类型有意义的属性。

此外,这也可能是由于 TIndexDef 中的参数无效造成的。 例如,TIndexDef 实例不支持 ixExpression 索引,尽管 IndexDef 集合编辑器允许您设置此选项。

祝你好运...

Lieven is correct in noting that certain TFields have different needs, as far as their properties, before the ClientDataSet to which they are associated can be created (using CreateDataSet). But the TGuid field is not the only one.

If you are having trouble determining which of the fields are causing the problem, comment out all field types except one, TStringField for instance, and then try to create the ClientDataSet. If that first group causes no problems, move onto the next. It could be as simple as a BDC (binary coded decimal) field, or something more exotic.

Once you find a field type whose presence causes the error, use the help and make sure that you are including only properties meaningful for that field type.

Also, this could also be due to an invalid parameter in an TIndexDef. For example, TIndexDef instances do not support ixExpression indexes, even though the IndexDef collection editor permits you to set this option.

Good luck...

何以心动 2024-07-19 13:09:32

我遇到了同样的麻烦,没有明显的原因..然后我偶然发现了这一点。
在表单设计器中切换到文本视图并切换回表单视图 (alt+f10)
现在尝试再做一次。 它对我有用过几次。 我认为这是一个错误造成的,随着组件的重新创建,它就会消失。

i was in same trouble, there was no apparent reason.. and then I discovered that by chance.
Switch to text view and switch back to form view in form designer (alt+f10)
Now try to do it again. It worked for me for several times. I think a bug causes that and with recreation of components it goes away..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文