Why is my MS Access database always broken?
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开发者_StackOverflow社区 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.
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 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.
精彩评论