Question

My setup is using Access 2000 with linked tables to an SQL 2008 server.

I have created a form that displays data from a single linked table that joins with 1 field from a view in the database (see SQL below). The relationship between the table and the view is a 1:1, why this should not cause a problem. However, I experience that I cannot update records in the recordset via the form. I get the error message "Recordset cannot be updated" when attempting to write in one of the fields.

According to http://rogersaccessblog.blogspot.dk/2009/11/this-recordset-is-not-updateable-why.html there is a lot of problems regarding this, but I would say I fulfill the rules for not having the recordset not being updateable.

I have seen it work with the same setup, so I am puzzled as to why it locks the recordset now.

This is my SQL query:

    SELECT dbo_Balance.*, 
[dbo_Amount_summary_all_specifications].[SUM_AMOUNT] AS Specification
    FROM dbo_Amount_summary_all_specifications 
RIGHT JOIN dbo_Balance ON 
([dbo_Amount_summary_all_specifications].[Version]=[dbo_Balance].[Version]) AND
([dbo_Amount_summary_all_specifications].[Year]=[dbo_Balance].[Year]) AND
([dbo_Amount_summary_all_specifications].[Period]=[dbo_Balance].[Period]) AND
([dbo_Amount_summary_all_specifications].[Kardex]=[dbo_Balance].[Kardex]) AND
([dbo_Amount_summary_all_specifications].[Account]=[dbo_Balance].[Account])

WHERE [dbo_balance].[Balance]<>0;

Thank you in advance!

UPDATE 2014-03-12

My source for the data in my SQL database:

CREATE VIEW [dbo].[VW_Overview_balance]
AS SELECT TOP (100) PERCENT dbo.Balance.ID, dbo.Balance.Year, dbo.Balance.Period,
dbo.Balance.Version, dbo.Balance.Kardex, dbo.Balance.Account, dbo.Balance.Kardex_name,
dbo.Balance.Kardex_code, dbo.Balance.Kardex_hierarki, dbo.Balance.Coop_franchise,
dbo.Balance.Chain, dbo.Balance.Chain_name, dbo.Balance.Responsible, 
dbo.Balance.Balance, dbo.Balance.Comment, dbo.Balance.Bank_account, 
dbo.Balance.Approver, dbo.Balance.Timestamp, dbo.VW_specifications_bank.SUM_AMOUNT_bank,
dbo.VW_specifications_system.SUM_AMOUNT_system,dbo.VW_specifications_erp.SUM_AMOUNT_erp, 
dbo.VW_specifications_user.SUM_AMOUNT_user, dbo.SUM_Total_Balance.Tot_Balance, - 
ISNULL(dbo.Balance.Bank_account, 0) - ISNULL(dbo.VW_specifications_erp.SUM_AMOUNT_erp, 0) 
+ ISNULL(dbo.VW_specifications_bank.SUM_AMOUNT_bank, 0) - 
ISNULL(dbo.VW_specifications_system.SUM_AMOUNT_system, 0) - 
ISNULL(dbo.VW_specifications_user.SUM_AMOUNT_user, 0) AS Specification, 
dbo.SUM_Total_Balance.Tot_Balance - ISNULL(dbo.Balance.Bank_account, 0) - 
ISNULL(dbo.VW_specifications_erp.SUM_AMOUNT_erp, 0)  +
ISNULL(dbo.VW_specifications_bank.SUM_AMOUNT_bank, 0) -
ISNULL(dbo.VW_specifications_system.SUM_AMOUNT_system, 0)  -
ISNULL(dbo.VW_specifications_user.SUM_AMOUNT_user, 0) AS Difference, dbo.Account.Account_name

FROM dbo.Balance LEFT OUTER JOIN dbo.Account ON 
dbo.Balance.Account = dbo.Account.Account_no LEFT OUTER JOIN dbo.SUM_Total_Balance 
ON dbo.Balance.ID = dbo.SUM_Total_Balance.ID LEFT OUTER JOIN dbo.VW_specifications_bank 
ON dbo.VW_specifications_bank.Balance_id = dbo.Balance.ID LEFT OUTER JOIN dbo.VW_specifications_erp 
ON dbo.VW_specifications_erp.Balance_id = dbo.Balance.ID LEFT OUTER JOIN dbo.VW_specifications_system 
ON dbo.VW_specifications_system.Balance_id = dbo.Balance.ID LEFT OUTER JOIN dbo.VW_specifications_user
ON dbo.VW_specifications_user.Balance_id = dbo.Balance.ID

WHERE     (dbo.Balance.Kardex_code <> 3) 
AND (dbo.Balance.Kardex_code <> 13) 
AND (dbo.SUM_Total_Balance.Tot_Balance <> 0) 
AND (dbo.Balance.Account IN
(SELECT Account_no FROM dbo.Account AS Account_1))

The query in the Access database has been reduced to:

SELECT dbo_VW_Overview_balance.Kardex, dbo_VW_Overview_balance.Account,
dbo_VW_Overview_balance.Kardex_name, dbo_VW_Overview_balance.Kardex_hierarki,
dbo_VW_Overview_balance.Coop_franchise, dbo_VW_Overview_balance.Chain_name,
dbo_VW_Overview_balance.Responsible, dbo_VW_Overview_balance.Comment,
dbo_VW_Overview_balance.Approver, dbo_VW_Overview_balance.Tot_Balance,
dbo_VW_Overview_balance.Specification, dbo_VW_Overview_balance.Difference,
dbo_VW_Overview_balance.Year, dbo_VW_Overview_balance.Period,
dbo_VW_Overview_balance.Version, dbo_VW_Overview_balance.Account_name

FROM dbo_VW_Overview_balance

ORDER BY dbo_VW_Overview_balance.Kardex, dbo_VW_Overview_balance.Account;
Was it helpful?

Solution

With the help from support.microsoft.com/KB/304179 I figured a solution: Though I had primary keys on the SQL database, I had not configured this in the linked table in Access as well. By updating the linked table and manually assigning the primary key, I can now update the recordset through both query and form!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top