Microsoft Knowledge Base Email Alertz

(307925) - You cannot update data in a view in a Microsoft Access project (ADP).

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 307925 - Last Review: July 27, 2006 - Revision: 6.0

ACC2002: You Cannot Update a View in a Microsoft Access Project

This article was previously published under Q307925
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access project (.adp).

On This Page

SYMPTOMS

You cannot update data in a view in a Microsoft Access project (ADP).

RESOLUTION

To resolve this issue, do the following:
  1. Install the Microsoft Data Access Components (MDAC) 2.6 on the client computer. You can download MDAC 2.6 from the following Microsoft Web site:
    http://msdn.microsoft.com/data/Default.aspx (http://msdn.microsoft.com/data/Default.aspx)
  2. Verify the following setting:
    • In Microsoft Access, open your view in Design view.
    • On the View menu, click Properties.
    • On the View tab, make sure that the Update using view rules check box is selected.

      NOTE: This tells the Windows Cursor Engine in MDAC not to try the update by using the base tables, but to update directly against the view definition.

MORE INFORMATION

The Update using view rules property indicates that all updates and insertions to the view will be translated by MDAC into SQL statements that refer to the view, rather than into SQL statements that refer directly to the base tables of the view.

Steps to Reproduce the Behavior

  1. Create a new SQL Server user. Set the user's default database to Northwind.
  2. In the Northwind database on SQL Server, create the following view and name it vwAllCustomers:
    SELECT * FROM Customers
    					
  3. Give the new user full permissions to vwAllCustomers. Give the new user no permissions to the underlying Customers table. Remove permissions of the public role to the Customers table.
  4. Log on as the new user. Open SQL Query Analyzer. Verify the following:
    1. You cannot run the following as this user:
      SELECT * FROM Customers
      						
    2. You can run the following:
      SELECT * FROM vwAllCustomers
      						
    3. You can run the following; that is, the view permissions allow the user to update the data through the view, but allow no access to the underlying table.
      UPDATE vwAllCustomers SET ContactName = 'Maria Anderson' WHERE CustomerID = 'ALFKI'
      						
  5. Create a new ADP as the new user that uses the existing Northwind database as the back end.

    Note that if you try to edit data through the vwAllCustomer view, you cannot do so.

REFERENCES

For more information about security in Microsoft SQL Server, see SQL Server Books Online, which is available at the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b)

APPLIES TO
  • Microsoft Access 2002 Standard Edition
Keywords: 
kbprb KB307925
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate