为什么我的 MS Access 数据库总是损坏?
我编写了一个作为服务运行的程序,需要频繁访问 MS Access 数据库。一段时间后,我的程序自动退出,然后我用Office打开我的MS Access数据库,它说它已损坏!
这看起来很奇怪,因为我的程序只执行一些非常常见的数据库访问:插入、选择和删除。为什么运行一段时间后总是坏掉?
这里有人遇到过这样的问题吗?任何建议表示赞赏。
I wrote a program running as a service that need to frequently gain access to MS Access database. After a period of time, my program exits automatically, then I open my MS Access database with Office, it says it is broken!
It seems very strange as my program do just some very common database access: insert, select and delete. Why is it always broken after running a period of time?
Has anyone here ever run into such problem? Any advice is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在处理 Access(或 Excel、Outlook...)时,几乎所有此类性质的问题都是由于未正确释放(即清理)资源造成的。
建议您发布您看到的任何错误。
Almost all problems of this nature when dealing with Access (or Excel, Outlook...) are due to not correctly releasing (i.e. cleaning up) resources.
Suggest you post any errors you are seeing.
如果程序在未关闭数据库的情况下终止,Access 将无法正常恢复。 Access 使用了一个脏标志,修复功能将重置它(除其他外),但通常情况下,我不建议在需要任何可靠处理的情况下使用 Access。
Access does not recover gracefully if a program terminates without closing the database. There is a dirty flag that Access uses, and the repair feature will reset it (amongst other things), but typically, I don't recommend Access where any robust handling is required.