创建设置后尝试更新访问数据库时出现异常 [英] Exception while trying to update access database after creating a setup

查看:107
本文介绍了创建设置后尝试更新访问数据库时出现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在c#中为我的应用程序创建了一个安装项目。

问题是名为System.Data.OleDb.OleDbException:Operation必须使用可更新的查询的错误。当我的应用程序尝试在访问2007数据库中插入一行时发生。

数据库安装在安装.exe文件的同一文件夹中。



我已经检查了数据库的权限,但没有找到以编程方式为数据库更改权限的地方。



提前谢谢!

I have created a setup project for my application in c#.
The problem is that an error named: "System.Data.OleDb.OleDbException: Operation must use an updateable query." occurs while my application tries to insert a row in the access 2007 database.
the database is installed in the same folder where the .exe file is installed.

I have checked for the permissions to the database but found no place to change the permission programatically for the database.

Thank you in advance!

推荐答案

简单:不要在程序文件夹中安装数据文件。

限制访问程序文件(和子文件夹)以减少损害通过病毒和类似的应用程序。

相反,将Db存储在合理的位置:我应该在哪里存储我的数据? [ ^ ]应该可以帮助您找到更适合的地方。
Simple: don't install data files in program folders.
Access to Program Files (and subfolders) is restricted to reduce the harm done by virus and similar applications.
Instead, store the Db in a sensible location: Where should I store my data?[^] should help you find somewhere more appropriate.


这篇关于创建设置后尝试更新访问数据库时出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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