“操作必须使用可更新的查询". MS Access中的错误 [英] "Operation must use an updateable query" error in MS Access

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

问题描述

我收到错误消息:尝试运行SQL时,操作必须使用可更新的查询".据我了解,这是在MS Access中的更新/删除查询中使用联接时发生的.但是,我有点困惑,因为我的数据库中还有另一个查询几乎相同,而且可以正常工作.

I am getting an error message: "Operation must use an updateable query" when I try to run my SQL. From my understanding, this happens when joins are used in update/delete queries in MS Access. However, I'm a little confused because I have another query almost identical in my database which works fine.

这是我麻烦的查询:

UPDATE [GS] INNER JOIN [Views] ON 
    ([Views].Hostname = [GS].Hostname) 
    AND ([GS].APPID = [Views].APPID) 
    SET 
        [GS].APPID = [Views].APPID, 
        [GS].[Name] = [Views].[Name], 
        [GS].Hostname = [Views].Hostname, 
        [GS].[Date] = [Views].[Date], 
        [GS].[Unit] = [Views].[Unit], 
        [GS].[Owner] = [Views].[Owner];

就像我之前说的,我很困惑,因为我有另一个与此类似的查询,它运行得很好.这是该查询:

As I said before, I am confused because I have another query similar to this, which runs perfectly. This is that query:

UPDATE [Views] INNER JOIN [GS] ON 
[Views].APPID = [GS].APPID 
SET 
    [GS].APPID = [Views].APPID, 
    [GS].[Name] = [Views].[Name], 
    [GS].[Criticial?] = [Views].[Criticial?], 
    [GS].[Unit] = [Views].[Unit], 
    [GS].[Owner] = [Views].[Owner];

我的第一个查询出了什么问题?为什么第一个查询不起作用,第二个查询为什么起作用?

What is wrong with my first query? Why does the second query work when the first doesn't?

推荐答案

这个答案是否普遍正确,我不知道,但是我通过稍微更改查询来解决了这个问题.

Whether this answer is universally true or not, I don't know, but I solved this by altering my query slightly.

我将选择查询更改为创建临时表,而不是将选择查询连接到表并对其进行处理.然后,我将该临时表用于实际表,并且一切正常.

Rather than joining a select query to a table and processing it, I changed the select query to create a temporary table. I then used that temporary table to the real table and it all worked perfectly.

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

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