Search code examples
ms-access

"Operation must use an updateable query" error in 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.

This is my troublesome query:

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?


Solution

  • 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.