VBAProject调用mysql出错,无法打开数据库,因为其中包含的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

thank you

解决方案

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.

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"

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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值