访问:操作必须使用可更新的查询 - 用于运行的查询没有问题

时间:2015-04-17 15:28:20

标签: sql ms-access ms-access-2010

所以最令人费解的是这个查询曾经起作用。虽然我添加了许多新查询,但绝对没有对此查询进行任何更改,也没有对查询中引用的两个查询/表的结构进行任何更改。

UPDATE INFORCE 
       INNER JOIN [Transactions] 
               ON INFORCE.[Cert Num] = [Transactions].[Cert Num] 
SET    INFORCE.[Prev Trans] = [INFORCE].[Trans], 
       INFORCE.[Prev Trans Dt] = [INFORCE].[Trans Dt], 
       INFORCE.Trans = [Transactions].[Trans], 
       INFORCE.[Trans Dt] = [Transactions].[Trans Dt], 
       INFORCE.[Count of Trans] = [INFORCE].[Count of Trans] + 1, 
       INFORCE.[Cancel Date] = [Transactions].[Trans Dt], 
       INFORCE.Status = "CAN", 
       INFORCE.Cost = [INFORCE].[Cost] 
                         + [Transactions].[Cost], 
       INFORCE.Tax = [INFORCE].[Tax] 
                     + [Transactions].[Tax], 
       INFORCE.[Last Reporting Month] = 
       [Transactions].[Reporting Month] 
WHERE  [Transactions].Trans = 'CN'; 

我对此文件的保存位置具有完全读/写权限。一切都在同一个accdb文件中,其他地方没有链接。

出了什么问题?

编辑:[INFORCE]是一个表格,[Transactions]是一个查询。以下我认为非常相似的查询运行没有问题。 [EN Final]是一个表格。

UPDATE INFORCE AS inf 
       INNER JOIN [EN Final] AS tr 
               ON inf.[Cert Num] = tr.[Cert Num] 
SET    inf.[Prev Trans] = inf.[Trans], 
       inf.[Prev Trans Dt] = inf.[Trans Dt], 
       inf.Trans = tr.[Trans], 
       inf.[Trans Dt] = tr.[Trans Dt], 
       inf.[Count of Trans] = inf.[Count of Trans] + tr.[Count of Trans], 
       inf.Cost = inf.[Cost] + tr.[Cost], 
       inf.Tax = inf.[Tax] + tr.[Tax], 
       inf.[Last Reporting Month] = tr.[Reporting Month], 
       inf.[Ins Start Date] = tr.[Ins Start Date], 
       inf.[Ins End Date] = tr.[Ins End Date], 
       inf.[Days Insured] = tr.[Days Insured];

0 个答案:

没有答案