将数据集与 TClientdatasets 嵌套在两个以上级别?
我想知道是否可以将数据集嵌套在数据集中,然后将此数据集嵌套在另一个数据集中。因此有 3 层嵌套。目前,我只能将一个数据集嵌套在另一个数据集中。当尝试嵌套第三层时,数据库在我第一次编译程序并且能够输入数据时成功运行。当我第二次尝试运行该程序时,EDBClient 引发了一条异常,并显示消息“数据包不匹配”。
所以我想知道是否可以将 3 层数据集相互嵌套?
亲切的问候 瑞安
I would like to know if it is possible to nest a dataset within a dataset and then nest this data set with in another dataset. Therfore 3 levels of nesting. Currently I only manage to nest one dataset with in the other. When attemting to nest the third level the database manages to run successfully the first time I compile my program and I am able to enter data. When I then attempt to run the program the second time I an execption raised by EDBClient with message "mismatch in datapacket".
So I would like to know is it possible to nest 3 levels of datasets within each other?
Kind regards
Riaan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
短篇故事:
使用Delphi XE尝试...对于我现在的主要项目,这解决了该错误。
长话短说:
当 Delphi 2010 的数据库端出现任何错误时,我遇到了与 3 级或更多级别的嵌套数据集相同的问题。
我经常使用的上一个版本是 Delphi 2007,没有问题,因此,不良行为有可能是在 Delphi 2009 或 Delphi 2010 中引入的。
我将此问题追溯到客户端的 midas.dll,无论您是否使用 MidasLib 静态链接 midas,都会发生这种情况。 Midas“认为”从服务器接收到的数据包格式错误,并引发异常。此异常破坏了“正常”错误协调过程,因此无法尝试从错误中恢复:OnReconcileError 从未触发,并且由于 VCL 这部分内缺少 try/ except 块,该过程被中止。
我确信这是一个错误,但如果它发生在服务器或客户端,则不会,当我正在制作一个项目来放置支持票时,同时试图将其减少到尽可能低的水平,它发生了 Delphi XE 已发布,而我在 SA 下,所以我在最后一刻才得到它。
下载、安装、配置...然后,我编译了我的来支持项目,一切正常。我编译了我的主要项目:由于这个原因,我面临着用户的实际问题,并且由于最后一秒验证或状态/条件更改,我使用数据库触发器和存储过程引发异常。一切都很好。用户收到有意义的错误消息,应用程序恢复了执行数据转换和即时重试的能力,或者询问用户在某些情况下要做什么。
抱歉,在诊断此问题并将其报告给 Embarcadero 的过程中,我没有找到解决方法,也许其他人可以更好地帮助您,而无需建议升级。
Short story:
Try it with Delphi XE... for my nowadays main project this resolved the bug.
Long story:
I faced the same problem you have with 3 or more levels of nested datasets when there's any error on the database side with Delphi 2010.
The previous last version I heavily used was Delphi 2007 without problems, so there's a chance the bad behavior was introduced in Delphi 2009 or Delphi 2010.
I traced this problem down to midas.dll on the client side, and it happens no matter if you're linking midas statically using MidasLib. Midas "thinks" the packet it receives from the server is malformed, and raises the exception. This exception breaks the "normal" error reconcile process, so there's no way to try to recover from an error: OnReconcileError never fired and the process is aborted due to the lack of try/except blocks inside this part of the VCL.
I'm sure it was a bug, but not if it happens on the server or on the client side, When I was working to produce a project to put a support ticket, while trying to reduce it to the minimum possible, it happens Delphi XE was released and I'm under SA, so I get it the last minute.
Download, Install, configure... then, I compiled my to support project and everything worked fine. I compiled my main project: the one where I was facing real problems with the users because of this and the fact I use to raise exceptions in database triggers and stored procedures due to last second validations or state/condition changes. Everything worked fine. The user is receiving meaningful error messages and the application recovered his ability to perform data-transformations and retries on the fly, or to ask the user what to do in some circumstances.
Sorry, I found no workaround during my efforts to diagnose and report this problem to Embarcadero, maybe someone else can help you better without suggesting to upgrade.
简单的答案是肯定的,您可以将三个级别的数据集相互嵌套。我有 ClientDataSets 的示例,其中嵌套下降了 6 层。事实上,我认为除了内存限制之外,嵌套深度没有限制。
Simple answer is yes, you can have three levels of datasets nested within each other. I have examples of ClientDataSets where the nesting goes down 6 levels. In fact, I do not think there is a limit to the depth of nesting, other than that imposed by memory constraints.