如何确保两种不同形式的记录集是一样的? [英] How to be sure that the recordsets of two different forms are the same?

查看:45
本文介绍了如何确保两种不同形式的记录集是一样的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两种不同的形式使用相同的查询作为数据源,但有时过滤器会被更改,有时我必须重新同步信息。

重新查询过程需要很长时间,如果表单已经有相同的记录集,我不必花时间。

有没有办法确定Form1的记录集与Form2的记录集完全相同?我的意思是:任何标签或校验和或特殊功能或类似的东西,可以说两个记录集在要求程序之前是相同的吗?


祝你好运

里卡多de Milano

I have two different forms that uses the same query as data origin, but sometimes the filters are changed and other times I have to resyncronize the informations.
The requery procedure takes so long and if the forms already have the same recordset, I don''t have to spend that time.
Is there any way to be sure that the recordset of Form1 is exactly the same as the recordset of Form2? I mean: Any tag or checksum or special function or something like this that could say that two recordsets are identical before a require procedure?

Best regards
Ricardo de Milano

推荐答案

+您可以在表单之间使用自定义事件来触发重新查询;但是,我建议您查看代码以动态更改过滤器,而不是对同一数据使用两个单独的表单,或者查看重新创建表单使用选项卡式控件而不是双重表单。


自定义事件可以使用繁琐,动态过滤器可以直接实现,选项卡式控件是下一个最简单的方法。


+两个单独表单背后的任何特殊原因。?
+ You can use a custom event between forms to trigger a requery; however, what I suggest is that you either look at code to alter the filter dynamically instead of using two separate forms for the same data, or look at recreating the form using a tabbed control instead of dual forms.

Custom events can be fussy to work with, the dynamic filters are straight forward to implement, and the tabbed control is the next easiest method.

+ Any particular reason behind the two separate forms.?


我通常首先为记录集创建SQL。完成后,我将其与表格'' .Recordset 属性进行比较。如果他们是一样的我不再做了。如果他们不同我从我制定的字符串中设置 .Recordset


我不明白你是什么我一直在问,因为我没有看到匹配两种形式的情况是否合理,如果它确实存在,那么你的问题中没有任何东西可以表明哪种形式应该被认为是主人,或者是正确的。一旦你知道了,你只需将另一个与主人进行比较,只有在它不同时才应用它。正如您通常应用 .Recordset 那样,您已经解决了所需的问题。
I typically create the SQL for the recordset first. Once that''s done I compare this with the form''s .Recordset property. If they''re the same I do no more. If they''re different I set .Recordset from the string I worked out.

I don''t understand what you''re asking about as I see no scenario where matching two forms makes sense, and if it did there''s nothing in your question to indicate which should be considered the master, or correct. Once you know that though, you''d simply compare the other with the master and apply it only if it were different. Very much as you would normally when it comes to applying a .Recordset that you''ve worked out to be what''s required.


我想我们可以调用
I think we can call
展开 | 选择 | Wrap | 行号


这篇关于如何确保两种不同形式的记录集是一样的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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