Delphi DBExpress父级子级没有找到相应的主记录 [英] Delphi DBExpress Parent Child No corresponding master record found

查看:121
本文介绍了Delphi DBExpress父级子级没有找到相应的主记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DBExpress连接到MySQL。我在两个表之间有一个主从关系。我通过DatasetProvider提供父表。在客户端,我有2个clientdatasets。其中之一访问提供程序,具有所有父项字段和子项的嵌套数据集字段。第二个clientdataset数据集字段属性设置为父级的嵌套数据集字段。

I am using DBExpress to connect to MySQL. I have a master detail relationship between two tables. I am providing the parent table via DatasetProvider. On the client side I have 2 clientdatasets. One of them accesses the provider, has all the parent field + the nested dataset field of the child. The second clientdataset Dataset field property is set to the nested dataset field of the parent.

现在,当我在子数据集中添加新记录时,出现错误找不到相应的主记录。

Now when I add a new record in the child dataset, it gives me an error "No corresponding master record found."

不知道为什么。

Nirav

推荐答案

在进行链接时,clientdataset和tdatasetfields(嵌套数据集)中存在一个大错误。
在XE和XE2中会发生这种情况
规则:
如果要使用一个提供程序嵌套数据集,则链接表Period必须具有相同的列名。

There is a big bug in clientdataset and the tdatasetfields (nesteddataset) when you do link. This happens in XE and XE2 Rules: If you want nested dataset with one provider, you must have the same column name for link table Period.

这篇关于Delphi DBExpress父级子级没有找到相应的主记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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