简体   繁体   English

Access 2016更新查询

[英]Access 2016 Update Query

Can anyone help me with an access update query please? 谁能帮助我进行访问更新查询?

It was working fine when the DB was an MDB file but since upgrading to ACCDB, the query won't run and gives: 当数据库是MDB文件时,它工作正常,但是由于升级到ACCDB,该查询将无法运行并给出:

Operation must use updatable query 操作必须使用可更新查询

However, it will run if opened in design view first and then opened from design view. 但是,如果先在设计视图中打开然后从设计视图中打开,它将运行。 Data is displayed as expected. 数据按预期显示。

The DB security is confirmed as trusted and I have set the trust locations accordingly. 数据库安全性被确认为受信任,并且我已相应地设置了信任位置。

The SQL for this query is: 该查询的SQL是:

UPDATE (tblStock INNER JOIN tblStockPricing ON tblStock.StockID = tblStockPricing.StockID) INNER JOIN tblWorkings ON tblStock.StockID = tblWorkings.wkgStockControlStockID SET tblWorkings.wkgPartNo = tblStock.Description, tblWorkings.wkgStockCode = tblStock.StockCode & tblStock.SortOrder & ' * ', tblWorkings.wkgTradePrice = tblStockPricing.InternalPrice
WHERE (((tblWorkings.wkgStockCode) Is Not Null) AND ((tblWorkings.DesignID)=15726) AND ((tblWorkings.wkgStockControlStockID) Is Not Null));

This issue was tracked down to my access front end linked tables to a backend SQL server where the tables didn't have a primary key. 这个问题被追溯到我的访问前端链接表到后端SQL Server的地方,该表没有主键。

The primary key was present in the original MDB file but after upgrading to ACCDB file, the primary keys are not present and need to be manually setup again. 主键存在于原始MDB文件中,但是升级到ACCDB文件后,主键不存在,需要再次手动设置。

Hope this help others. 希望这对别人有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM