操作必须使用可更新查询 [英] operation must use an updateble query

查看:110
本文介绍了操作必须使用可更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署了一个应用程序,它仅支持DQL查询,但是当我尝试运行DML查询(如插入/删除/更新)时,它将引发错误:

操作必须使用可更新的查询

我认为数据库是只读的.

但是我检查了数据库文件的只读属性,但是它也是错误的,仍然无法正常工作,并且出现相同的错误.

I have deployed an application and it support only DQL query but when I try to run DML query like insert/delete/update then it is throwing error:

Operation must use an updateble query

I think the database is read-only.

But I have checked read-only property of database file, but it is also false, still it is not working and same error.

推荐答案

我看到了两个可能的问题马上行动.首先,连接到SQL的帐户是否具有对该特定表的权限?您可以隐式或显式拒绝用户写入表或数据库的功能.

另一种可能性是您要写入的项目不可更新. Shahin提到它可能是一个View.

第三种选择是,您打开与数据库的连接的方式使其变为只读.

第四,数据库可能因为违反了设置规则(引用完整性,触发器等)而拒绝了您的更改.您可能需要检查以确保可以在SSMS中运行脚本(如果使用的是SQL),以确保该脚本本身将起作用.

第五,您可能正在尝试更新包含联接的查询.例如,如果将两个表连接在一起,然后尝试更新两组表数据,则会收到错误消息.在Access中,即使仅更新一个表中的数据,也会出现错误.

最后,如果您使用的是Microsoft Access这样的数据库,则您的用户可能无权在数据库所在的特定文件夹中修改/创建文件.不要忘了Access在进行写操作时会创建LDF文件(因此,文件修改操作和文件创建操作以及删除LDF之后的文件删除操作).

以下是一些可能会有所帮助的文章:

http://www.mikesdotnetting.com/Article/74/解决操作中必须使用的可更新查询错误 [ http://support.microsoft.com/kb/175168 [ http://stackoverflow.com/questions/170578/operation-must-use-an-updatable-query-error-3073-microsoft-access [
I see a couple possible issues right off the bat. First, does the account that is connecting to SQL have rights to that particular table? You can either implicitly or explicitly deny a user the ability to write to a table or a database.

Another possibility would be that the item you are writing to is not updatable. Shahin mentioned that it might be a View.

A third option would be that the way you are opening the connection to the database makes it read-only.

Fourth, the database might be rejecting your changes because it violates a set rule (referential integrity, a trigger, etc.) You might want to check to be sure you can run the script in SSMS (if you are using SQL) to be sure the script itself will work.

Fifth, you might be trying to update a query that contains a join. For instance, if you are joining two tables together and then trying to update both sets of table data, you will get an error. In Access, you will get an error even if you only update one table''s worth of data.

Finally, if you are using a database like Microsoft Access, your user might not have rights to modify/create a file in the particular folder where the database is located. Don''t forget that Access creates an LDF file when writes are being made (thus a file modify operation and a file create operation and later a file delete operation when the LDF is removed).

Here are some articles that might help:

http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error[^]

http://support.microsoft.com/kb/175168[^]

http://stackoverflow.com/questions/170578/operation-must-use-an-updatable-query-error-3073-microsoft-access[^]


这篇关于操作必须使用可更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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