连接的MS Access使用相同的MS接取文件,而其他应用程序 [英] Connecting MS Access while another application using the same MS Acess File

查看:236
本文介绍了连接的MS Access使用相同的MS接取文件,而其他应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个窗口的应用程序,试图连接的MS Access文件,该文件是齐全另一个应用程序使用。 当我停止该应用程序,然后我能够与MS Access文件连接。 否则,出现错误如下:

I have a window application which tries to connect a MS Access file which is all ready used by another application. When I stop that application then I am able to connect with MS Access file. Otherwise an error occurs as follows:



OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "AccessDb" returned message "Cannot start your application.
The workgroup information file is missing or opened exclusively by another user.

有没有什么办法,我可以打开以只读模式的连接。 我只是从文件中读取数据。

Is there any way which I can open a connection in read only mode. I have to just read data from that file.

感谢。

推荐答案

尝试添加模式=共享拒绝无这个应用程序锁定该数据库的连接字符串,以便连接字符串的样子

Try adding "Mode= Share Deny None" to the connection string of this application that is locking the DB, so that the connection string looks like

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyFolder\MyDb.mdb;Persist Security Info=False;Jet OLEDB:Database Password=My_Password;Mode= Share Deny None

此连接字符串应该由当前打开数据库以独占模式的应用程序。

This connection string should be used by the application that is currently opening the DB in exclusive mode.

这篇关于连接的MS Access使用相同的MS接取文件,而其他应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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