事件在 MS-Access 中不起作用

发布于 2024-08-07 07:38:44 字数 296 浏览 2 评论 0原文

我正在处理的数据库(在 MS-Access XP 中)似乎已损坏。它不再支持任何事件——点击、更改、更新事件,似乎没有任何作用。这是我得到的错误:

您作为事件属性设置输入的表达式 On Change 产生以下错误:对象或类不支持事件集。

我该怎么做才能让活动重新开始运作?我已经尝试过工具->数据库实用程序->压缩和修复数据库...,但它根本没有帮助。而且,情况并非一直如此 - 事件最初可以正常工作,但现在什么都不起作用,甚至自动生成的命令按钮也不起作用。

The database that I am working on (in MS-Access XP) seems to have become corrupted somehow. It no longer supports any events - clicks, change, update events, nothing seems to work. This is the error that I get:

The expression On Change you entered as the event property setting produced the following error: Object or class does not support the set of events.

What can I do to make events start working again? I have tried Tools->Database Utilities->Compact and Repair Database..., but it didn't help at all. Also, it hasn't been like this the whole time - events were originally working, but now nothing works, not even the auto-generated command buttons.

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

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

发布评论

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

评论(8

童话 2024-08-14 07:38:44

压缩和修复通常无法解决表和索引以外的对象中发生的问题。导入通常可以修复这些问题,但也可以尝试反编译然后导入。 反编译或如何减小 Microsoft Access MDB/MDE 大小并减少启动时间

我曾经遇到过同样的问题,并在此记录了我的故障排除步骤。 单击时的表达式您输入...

另请参阅损坏的 Microsoft Access 中的损坏对象MDB

总结了长时间的讨论。

可能有一个可能有帮助的解决方案的页面是在 Vista/Windows 7 下使用多个版本的 Access 时出现错误 这基本上是注册表的权限问题。

另一个建议是修复控制面板中的 Office 2003 安装。然后,A2003 恢复使用版本 11 的库,但直到再次使用 A2007,问题才会再次出现。

原发帖者表示“好吧,重新启动几次后,看来删除 2007 运行时确实解决了我的问题。”

Compact and repair generally won't solve problems that happens in objects other than tables and indexes. Importing usually fixes those but maybe try a decompile and then an import. Decompile or how to reduce Microsoft Access MDB/MDE size and decrease start-up times

I encountered the same problem once and documented my trouble shooting steps here. The expression On Click you entered ...

Also see Corrupt Objects within a Corrupt Microsoft Access MDB

Long discussion summarized.

One page that might have a solution that might help is Errors using multiple versions of Access under Vista/Windows 7 This is basically a permissions problem into the registry.

Another suggestion is to to repair the Office 2003 installation in control panel. A2003 then reverts to using Version 11 of the library, but only until A2007 is used again, then the problem reappears.

The original poster stated "Okay, after a few restarts, it seems that removing the 2007 runtime did fix the problem for me. "

浅浅 2024-08-14 07:38:44

托尼在他的一长串评论中提到了这一点,但这听起来与决斗的 Access 注册问题完全一样。直到最近我才使用过 A2007(我安装了运行时来测试 A2003 中开发的数据库是否可以部署在它下面 - 它可以 - 但自从测试完成以来就没有使用过它),当我运行A2007在我使用A2003之后,它必须重新配置自己。前几天,在 A2003 重新配置期间(上次运行 A2007 之后)出现了问题,我收到了与您类似的错误。运行 A2007(将所有内容重新注册为 A2007),然后运行 ​​A2003(将所有内容重新注册为 A2003)解决了该问题。

关键是,当重新注册失败时,Access 下次运行时不一定知道这一点,因此您最终会在部分注册 A2003、部分注册 A2007 的环境中运行。恢复的方法是运行其他版本的Access。也就是说,如果 A2003 在没有重新配置通知的情况下启动,则将其关闭并运行 A2007,以便它重新配置自身并将自身重新注册为真正的 Access。然后,当您下次运行 A2003 时,它将重新将自身注册为 Access 的权威版本,并且您的 A2003 应用程序应该拥有正确形状的所有引用。

是的,这很烦人。

而且很费时间。

我不知道为什么 MS 似乎认为这是不需要修复的问题。虽然我知道他们并不关心需要同时运行 A2003 和 A2007 的开发人员,但有很多最终用户可能安装了 A2007 运行时应用程序,但也将 A2003 作为其基本 Office 安装的一部分安装。

这种情况一直持续下去,所以我怀疑它是否会得到解决。

Tony alluded to this in his long string of comments, but this sounds exactly like the dueling Access registration problem. I hadn't used A2007 until recently (I had the runtime installed to test if a database developed in A2003 could be deployed under it -- it could -- but hadn't used it since that testing was completely), and when I run A2007 after I've been using A2003, it has to reconfigure itself. The other day, something went wrong during the A2003 reconfiguration (after having last run A2007) and I got errors similar to yours. Running A2007 (to re-register everything as A2007) and then running A2003 (to re-register everything as A2003) fixed the problem.

The key is that when the re-registration fails, Access doesn't necessarily know it the next time it runs, so you end up running in an environment that is partly registered for A2003 and partly for A2007. The way to restore it is to run the other version of Access. That is, if A2003 is launching without the reconfiguration notice, then close it down and run A2007 so it reconfigures itself and re-registers itself as the real Access. Then when you run A2003 next, it will re-register itself as the authoritative version of Access and your A2003 app should have all of its references in proper shape.

Yes, this is very annoying.

And time-consuming.

I don't know why MS seems to think this is something that doesn't need to be fixed. While I know they don't give a rat's ass about developers who need to run A2003 and A2007 side by side, there are plenty of end users who might have an A2007 runtime app installed but also have A2003 installed as part of their base Office installation.

This has been going on forever, so I doubt it will ever be fixed.

故事未完 2024-08-14 07:38:44

我在Access 2013中多次遇到同样的问题。从MS网站的页面上,我找到了解决我的问题的答案。我在这里分享一下。

  1. 我将代码安全地复制到 Access 之外的其他位置,即 Notepad++ 中。
  2. 然后我删除了整个发泄程序及其代码,该程序没有触发。
  3. 创建新的事件过程,并将代码从 Notepad++ 恢复到新创建的事件过程。
  4. 早些时候未发射的事件开始时没有任何故障。问题解决了。

我不知道为什么会出现这个问题。这个问题已经出现过很多次了,每次都是用同样的解决方案解决的。

尝试一下。

I have encountered the same problems many times in Access 2013. From a page on MS web site, I found the answer which solved my problem. I am sharing it here.

  1. I copied the code safely somewhere else outside Access, in the Notepad++.
  2. Then I deleted entire vent Procedure, with its code, which was not firing.
  3. Created fresh Event procedure, and restored the code from Notepad++ to the newly created Event Procedure.
  4. The event earlier not firing started without any glitch. The issue got solved.

I don't know why the problem appears. This problem has come up many times and every time it is resolved with the same solution.

Try it.

离去的眼神 2024-08-14 07:38:44

尝试反编译并重新编译数据库。

如果这不起作用,我通常会创建一个新数据库并将所有内容从该数据库导入到新数据库中。如果某些东西损坏了,我当时就会遇到问题并能够修复它。

Try to decompile and recompile the database.

If that does not work, I usually create a new database and import everything from this one to the new one. If something is corrupted, I will encounter issues at that time and be able to fix it.

莫相离 2024-08-14 07:38:44

你能看到你的代码模块中的代码吗?如果是这样,请将其剪切并粘贴到安全的地方。然后将每个表单的 HasModule 设置翻转为 false,修复数据库,并将代码恢复到新创建的代码模块。

Can you see the code in your code modules? If so, cut and paste it somewhere safe. Then flip the HasModule setting for each form to false, repair the database, and restore the code to newly created code modules.

眼趣 2024-08-14 07:38:44

您可以通过将标志 /decompile 添加到启动选项来反编译数据库,即

msaccess.exe “C:\my_folder\mydb.mdb” /decompile

我发现这解决了我的大部分问题。如果没有,则另一种方法是通过运行安全向导来重新保护数据库。这基本上会创建一个新数据库并为您导入所有对象

You decompile the database by adding the flag /decompile to the start-up options i.e.

msaccess.exe “C:\my_folder\mydb.mdb” /decompile

I find that solves most of my problems. If not then another one is to re-secure the database by running the security wizard. This basically makes a new db and imports all the objects for you

南风起 2024-08-14 07:38:44

我有类似的问题。当它开始时,我通过复制数据库创建了新版本的代码。这没有帮助。但是,从新数据库中删除该表单并从原始数据库中导入该表单解决了该问题。我没有收到任何有关代码损坏或其他的警告。它只是简单地工作,没有对 VBA 等进行任何更改。总而言之有点奇怪

I had a similar problem. When it started I created a new version of the code by copying the database. This did not help. However, deleting the form from the new database and importing it from the original solved the issue. I did not receive any warnings of corrupted code or other. It simply just worked without any changes to the VBA etc. Bit weird all in all

执手闯天涯 2024-08-14 07:38:44

我将数据库 (Access 2010) 压缩为一个新数据库。没有喜悦。删除了不起作用的表单并将其从旧数据库中导入。没有喜悦。重新编译。 高兴!不知道为什么它会退出以及为什么它现在可以工作。我怀疑表单上链接文本框中的大量文本存在问题。

I compacted the database (Access 2010) into a new one. No joy. Deleted the form that was not working and imported it from the old database. No joy. Recompiled. JOY! Not sure why it quit and why it now works. I suspect a problem with a large amount of text in a linked text box on the form.

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