操作必须使用可更新的查询ms访问权限 [英] operation must use an updateable query ms access

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

问题描述

所有我已经完成了我的Windows应用程序。我创建了我的项目的设置,但是当它的设置运行时,它在我的第一个表单中显示错误。实际上我使用acess2003数据库作为本地数据库。并使用以下连接字符串

 OleDbConnection con =  new  OleDbConnection(  Provider = Microsoft.Jet.OLEDB.4.0; Data Source = | DataDirectory | /Furniture.mdb); 



我使用windows7作为操作系统,我的系统是32位系统。它告诉我错误

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

i搜索很多并更改数据库文件的安全设置但仍显示相同的prblm ... plz help

解决方案

一个很可能的原因是运行程序的用户没有对数据库文件的读写权限,特别是如果它位于程序文件文件夹中。



因此,请检查目录和文件权限,并在需要时将其表达。您还可以考虑将数据库文件的位置更改为另一个更易于访问的文件夹。


当Jet 4.0数据库(由您的Accessmdb文件表示的实际数据库类型时) )部署在多用户环境中,每当打开数据库时都会创建.ldb文件。 .ldb文件包含的详细信息包括谁已打开文件,主要用于防止其他用户写入打开的记录。

在ASP.NET应用程序的上下文中,谁是用户QUOT;将取决于平台:对于XP Pro机器,用户是ASPNET帐户。在Windows Server 2003,2008和Vista上,它是NETWORK SERVICE帐户。但是,如果启用了ASP.NET模拟,则默认用户帐户将为IUSR_machinename,或者您应用的任何帐户。如果您不确定运行ASP.NET应用程序的帐户,Environment.UserName将返回它。为了能够创建,写入和删除所需的.ldb文件,相关用户需要对.mdb文件所在的文件夹具有MODIFY权限。

要设置此权限,请右键单击App_Data文件夹(或您将mdb文件放入其中的任何其他文件夹)并选择属性。查找安全选项卡。如果看不到,则需要转到我的电脑,然后单击工具并选择文件夹选项...,然后单击视图选项卡。滚动到底部并取消选中使用简单文件共享(推荐)。返回安全选项卡,您需要将相关帐户添加到组或用户名框中。单击添加....然后单击高级,然后单击立即查找。应列出相应的帐户。双击它以将其添加到组或用户名框,然后选中权限中的修改选项。而已。您已完成。


解决操作必须使用可更新查询错误


令人难以置信的神秘操作必须使用可更新查询错误 bane < span class =code-keyword> 开发人员刚刚开始 访问 ASP.NET。您' 已完成您的代码,将您的数据库文件填入App_Data文件夹(至少,您应该已经完成​​),并尝试运行INSERTs或UPDATEs记录的页面,它们都停止了。这篇简短的文章解释了错误的原因,以及阻止它再次发生所需的步骤。



当Jet 4.0数据库(由Accessmdb文件表示的实际数据库类型)部署在多用户环境中时,.ldb文件是每当打开数据库时都会创建。 .ldb文件包含的详细信息包括谁已打开文件,主要用于防止其他用户写入打开的记录。

在ASP.NET应用程序的上下文中,用户依赖于平台:对于XP Pro计算机,用户是ASPNET帐户。在Windows Server 2003,2008和Vista上,它是NETWORK SERVICE帐户。但是,如果启用了ASP.NET模拟,则默认用户帐户将为IUSR_machinename,或者您应用的任何帐户。如果您不确定运行ASP.NET应用程序的帐户,Environment.UserName将返回它。为了能够创建,写入和删除所需的.ldb文件,相关用户需要.mdb文件所在文件夹的MODIFY权限。

要设置此权限,请右键单击App_Data文件夹(或您将mdb文件放入其中的任何其他文件夹)并选择属性。查找安全选项卡。如果你'
看到它,你需要 go to 我的电脑,然后点击工具选择文件夹选项... 。然后点击查看标签。滚动 底部取消选中 < span class =code-string>使用简单文件共享(推荐)。返回 安全标签,您需要 添加相关帐户 用户名称框。点击添加 .... 然后点击高级,然后立即查找。应列出相应的帐户。 Double 点击 添加 it 用户名称框, 检查修改选项 的权限。 ' s。你完成了。

注意:此修复程序还将解决Microsoft Jet数据库引擎无法打开文件
(未知) 。它已被其他用户专门打开,或者您需要获得查看其数据错误的权限。







资料来源:

http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error [<一个href =http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error\"target =_ blanktitle =New Window> ^ ]





第二来源:

http://www.infolet.org/2013/06/fix-ms- access-operation-must-use-an-updateable-query-problem-error.html [ ^


Hiiii to all i have completed my windows application. I created the setup of my project but when its setup runs,it shows an error in my first form.Actually i am using acess2003 database as a local database. and uses the following connection string

OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/Furniture.mdb");


i m using windows7 as OS and my system is 32bit system. it show me the error
Operation must use an updateable query
i search a lot and change the security setting of database file but still it shows the same prblm... plz help

解决方案

One quite likely reason is that the user running the program doesn't have read-write access to the database file, especially if it is located in program files folder.

So check the directory and file permissions and moodify them if needed. You can also consider changing the location of the database file to another, more asily accessible folder.


When a Jet 4.0 database (the actual type of database represented by your "Access" mdb file) is deployed in a multi-user environment, an .ldb file is created whenever the database is opened. The .ldb file contains details which include who has opened the file, and primarily serves to prevent opened records being written to by another user.
In the context of an ASP.NET application, who the "user" is will depend on the platform: for XP Pro machines, the user is the ASPNET account. On Windows Server 2003, 2008 and Vista, it is the NETWORK SERVICE account. However, if you have ASP.NET Impersonation enabled, the default user account will be IUSR_machinename, or whichever account you have applied. If you are unsure which account your ASP.NET application is running under, Environment.UserName will return it. To be able to create, write to and delete the required .ldb file, the relevant user needs MODIFY permissions on the folder that the .mdb file is in.
To set this permission, right click on the App_Data folder (or whichever other folder you have put the mdb file in) and select Properties. Look for the Security tab. If you can't see it, you need to go to My Computer, then click Tools and choose Folder Options.... then click the View tab. Scroll to the bottom and uncheck "Use simple file sharing (recommended)". Back to the Security tab, you need to add the relevant account to the Group or User Names box. Click Add.... then click Advanced, then Find Now. The appropriate account should be listed. Double click it to add it to the Group or User Names box, then check the Modify option in the permissions. That's it. You are done.


Solving the Operation Must Use An Updateable Query error


The unbelievably cryptic Operation Must Use An Updateable Query error is the bane of developers who are just starting out with Access and ASP.NET. You've done your code, plopped your database file in the App_Data folder (or at least, you should have done), and try to run a page that INSERTs or UPDATEs records, and it all stops dead. This brief article explains the cause of the error, and the steps required to stop it recurring.



When a Jet 4.0 database (the actual type of database represented by your "Access" mdb file) is deployed in a multi-user environment, an .ldb file is created whenever the database is opened. The .ldb file contains details which include who has opened the file, and primarily serves to prevent opened records being written to by another user.

In the context of an ASP.NET application, who the "user" is will depend on the platform: for XP Pro machines, the user is the ASPNET account. On Windows Server 2003, 2008 and Vista, it is the NETWORK SERVICE account. However, if you have ASP.NET Impersonation enabled, the default user account will be IUSR_machinename, or whichever account you have applied. If you are unsure which account your ASP.NET application is running under, Environment.UserName will return it. To be able to create, write to and delete the required .ldb file, the relevant user needs MODIFY permissions on the folder that the .mdb file is in.

To set this permission, right click on the App_Data folder (or whichever other folder you have put the mdb file in) and select Properties. Look for the Security tab. If you can't see it, you need to go to My Computer, then click Tools and choose Folder Options.... then click the View tab. Scroll to the bottom and uncheck "Use simple file sharing (recommended)". Back to the Security tab, you need to add the relevant account to the Group or User Names box. Click Add.... then click Advanced, then Find Now. The appropriate account should be listed. Double click it to add it to the Group or User Names box, then check the Modify option in the permissions. That's it. You are done.

Note: this fix will also solve "The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data" errors.




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


2nd source:
http://www.infolet.org/2013/06/fix-ms-access-operation-must-use-an-updateable-query-problem-error.html[^]


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

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