无法打开数据库,因为其中包含的VBA项目无法读取 [英] The database cannot be opened because the VBA project contained in it cannot be read

查看:862
本文介绍了无法打开数据库,因为其中包含的VBA项目无法读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天早上,我遇到了这个错误

This morning, I got this error

Error accessing file. Network connection may be lost

无论我以任何形式在做什么.因此,我打开了一个空白数据库并导入了所有内容.发生了一些错误,但它表示导入已成功.我能够再次打开我的表格.然后我返回旧副本,然后在尝试打开数据库时出现此错误

no matter what I was doing on any form. So I opened a blank database and imported everything. Some error occurred but it said that the import was successful. I was able to open my form again. Then I went back the old copy and then I got this error when I try to open the database

The database cannot be opened because the VBA project contained in it cannot be read

即使我在第一个错误出现之前所做的备份现在也要这么说.

Even the backup I did before the first error is saying that now.

,我尝试再次导入,但是在导入时出现错误.

and I tried to import again and I got the error while it was importing.

我现在有点紧张,请告诉我有办法解决这个问题

I'm getting abit nervous now, plz tell me there's a way to fix this

谢谢

推荐答案

当Access抱怨无法读取VBA项目代码时,可以尝试反编译.有关详细说明,请参见此SO问题的两个答案:如何进行反编译和重新编译.

You can try decompile when Access complains it can't read the VBA project code. See the two answers to this SO question for detailed instructions: HOW TO decompile and recompile.

如果反编译无法将您的应用程序恢复到正常的工作状态,则最快的解决方案可能是还原到您的上一个良好的备份副本.

If decompile is unable to restore your application to good working order, the quickest solution is probably to revert to your last good backup copy.

如果您愿意花更多的精力来恢复自上次备份以来的模块更改,请检查您是否仍然可以访问模块源代码.如果源代码可读,则可以使用未公开的SaveAsText方法将代码转储到文本文件中:

If you're willing to put in extra effort to recover module changes since the last backup, check whether you can still access the module source code. If the source code is readable, you can use the undocumented SaveAsText method to dump the code to a text file:

Application.SaveAsText acModule, "Module1", "C:\SomeFolder\Module1.txt"

然后使用LoadFromText方法将其加载到新的db文件中.

Then later load it into a new db file with the LoadFromText method.

Application.LoadFromText acModule, "Module1", "C:\SomeFolder\Module1.txt"

这篇关于无法打开数据库,因为其中包含的VBA项目无法读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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