如何找到 MS Access 中使用缺失引用的位置
我的参考列表(在 VBA 代码视图中)中列出了缺少的参考。这是对我们不再使用的产品的 OCX 的引用。
我可以删除(取消选中)引用,但我想知道这是否会回来咬我。
有没有办法找出它可能被用在哪些表格/报告中?
删除它然后编译 MDB 就足够了吗?
I have a missing reference listed in my References list (in the VBA Code view). It's a reference to an OCX for a product that we no longer use.
I'm fine with removing(unchecking) the reference, but I'm wondering if that is going to come back to bite me.
Is there a way to find out in which forms/reports it might have been used?
Is removing it and then doing a compile of the MDB sufficient?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我相信如果您使用 Option Strict,那么编译应该捕获您引用不再存在的对象的任何问题
I believe if you are using Option Strict, then the compile should catch any issues where you have referenced an object that no longer exists
如果使用后期绑定,编译可能无法捕获它,但通常它会在编译中捕获它。您还可以通过运行重新编译的 MDB 来进行一些测试。
The compile might not catch it if it's using late binding, but usually it'll catch it in the compile. You can also do some testing by running the recompiled MDB.
如果产品是控件,则 Access 不会(默认情况下)让您这样查看“源”。
否则,我会在 VBA 代码中进行搜索以查看它的创建位置。
例如:
然后在整个项目中搜索 Old_Product。
根据您的应用程序的任务关键程度,我会删除它,看看会发生什么。
我假设您已经停用了旧产品?
根据我的经验,Access 应用程序并不是关键任务。如果它们停机一个小时(当您尝试修复旧参考时),这并不是世界末日。
If the product is a control, then Access doesn't (by default) let you look at the "source" like that.
Otherwise I would do a search in the VBA code to see where it is created.
eg:
Then do a search for Old_Product across the project.
Depending on how mission critical your application is, I would remove it and see what happens.
I'm assuming that you have decommissioned the old product?
In my experience, Access Applications aren't mission critical. If they go down for an hour (while you try and fix the old reference) it isn't the end of the world.