“操作必须使用可更新的查询"MS Access 中的错误 [英] "Operation must use an updateable query" error in 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屋!