确定是否有唯读权限的Access数据库 [英] Identify If Access database having ReadOnly Permission

查看:214
本文介绍了确定是否有唯读权限的Access数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 有关Acccess数据库,用信息公开这一数据库已opended只读。

  • For Acccess Database which open with Message "This database has been opended read-only".

有关这DB当我们连接使用C#.NET应用程序与OleDbconnectio ..at更新查询它给错误的时间操作必须使用一个可更新的查询。

For this DB when we connect using C#.net application with OleDbconnectio ..at time of updating Query it give Error "Operation must use an updateable query."

我只是想提示用户在DB与只读权限在Access数据库..
,我们如何在C#.net应用程序代码添加到同一性OLEDB数据库只读权限打开。

I just want to prompt user if DB opened with ReadOnly Permission In Access Database.. how can we add code in C#.net application to identiy oledb database ReadOnly Permission.

感谢

推荐答案

据我的记忆,访问可以否认尽管数据库文件是可写的,你写的。

As far as I can remember, Access can deny you writes despite the fact that database file is writable.

要检查它是尝试打开数据库后立即插入一些虚拟值的最佳方式。捕获异常,并通知用户。

Best way to check it is to try to insert some dummy value right after opening the database. Catch the exception and inform the user.

这篇关于确定是否有唯读权限的Access数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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