使用 ADO.NET 删除与 MS Access 数据库的所有连接
我正在尝试压缩 Access 数据库,但它失败了,因为与数据库的连接仍然打开。如何以编程方式删除与数据库的所有连接?
I am trying to compact an Access Database but it is failing because a connection to the database is still open. How can I drop all connections to the database programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
短答案你不能,长答案你可以!
没有像在 SQL 服务器上那样的内置方法来执行此操作,但是通过一些预先计划,您可以进行设置以将用户踢出数据库。请参阅本文,了解一些可以使用的方法
http://www.rogersaccesslibrary.com/ download3.asp?SampleName=LogUsersOff.mdb
Short answer you cant, long answer you can!
There is no built in way of doing this like on a SQL server however with a bit of preplanning you can set things up to kick users out of a database. See this article on some methods you can use
http://www.rogersaccesslibrary.com/download3.asp?SampleName=LogUsersOff.mdb
访问程序可能已打开或进程仍在运行。查看这两个链接以了解如何终止进程。
http://www.codeproject.com/KB/cs/cskillapp.aspx
http://www.csharpcorner.com/UploadFile/scottlysle/ProcessKillCSharp04302008060422AM/ProcessKillCSharp.aspx
The access program may be open or the process is still running. Check out these two links on how to kill processes.
http://www.codeproject.com/KB/cs/cskillapp.aspx
http://www.csharpcorner.com/UploadFile/scottlysle/ProcessKillCSharp04302008060422AM/ProcessKillCSharp.aspx