OleDbConnection.Open()在Windows 7(C#)中引发异常 [英] OleDbConnection.Open() throws exception in Windows 7 (C#)

查看:87
本文介绍了OleDbConnection.Open()在Windows 7(C#)中引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试使用OLEDBConnection类从数据库中打开MDB文件.
为此,我正在使用Open()方法.

此方法在Windows XP中正常工作(不返回任何异常并打开与指定文件的连接).
但是,它在Windows 7中失败.该方法引发异常" Microsoft Jet数据库引擎无法打开文件< file =" name =">.它已经由另一个用户以独占方式打开,或者您需要获得查看其数据的权限."

任何人都可以帮助解决这个问题吗?这向我证明了我执行项目的主要障碍.

我正在使用C#进行开发.

谢谢和问候,
Kishor Reddy

Hi All,

I am trying to open an MDB file from the database using OLEDBConnection class.
For this, i am using Open() method.

This method works fine in Windows XP(without returning any exception and opens the connection with the specified file).
However it fails in Windows 7. The method throws an exception "The Microsoft Jet database engine cannot open the file "<the file="" name="">". It is already opened exclusively by another user, or you need permission to view its data."

Can anyone helpme in this issue? This is proving to me major hindrance to my project execution.

i am using C# for the development purpose.

Thanks and Regards,
Kishor Reddy

推荐答案

好吧,错误消息很清楚,不是吗?
这与Windows版本无关,与安全性和权限有关.
在Google中搜索特定的错误消息可为您提供许多解决方案.
解决方案 [ Microsoft帮助 [等等. [
Well, the error message is pretty clear, isn''t it?
This has nothing to do with your Windows version, it has to do with security and permissions.
Searching for that specific error message in Google gives you lots of solutions.
Solution[^]
Microsoft help[^]
Etc.[^]
See if those help and if they don''t provide extra information as to why it doesn''t :)
Hope it helps!


这篇关于OleDbConnection.Open()在Windows 7(C#)中引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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