0

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

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

我该怎么做才能让活动重新开始?我已经尝试过Tools->Database Utilities->Compact and Repair Database...,但它根本没有帮助。此外,它一直都不是这样 - 事件最初是有效的,但现在没有任何效果,甚至是自动生成的命令按钮。

4

8 回答 8

4

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

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

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. "

于 2009-10-13T03:55:56.657 回答
3

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.

于 2009-10-14T02:27:02.990 回答
1

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.

于 2015-01-30T11:55:59.920 回答
0

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

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

于 2009-10-13T01:08:31.987 回答
0

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

于 2009-10-13T01:19:38.363 回答
0

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

于 2009-10-13T07:24:18.297 回答
0

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

于 2015-04-12T07:52:06.163 回答
0

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.

于 2015-05-31T03:25:28.243 回答