Microsoft Knowledge Base Email Alertz

KBAlertz.com: You cannot update the data in a view that you created in Office Access 2003

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]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

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




Article ID: 905476 - Last Review: September 21, 2005 - Revision: 1.4

You cannot update the data in a view that you created in Office Access 2003

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

On This Page

SYMPTOMS

When you open a view that you created in Microsoft Office Access 2003, the data in the view is read-only. Therefore, you cannot update the data.

CAUSE

This issue occurs if the following conditions are true:
  • The Update using view rules option is selected in the properties for the view.
  • The view contains a JOIN statement or a subquery.

    Note The JOIN statement can be an INNER JOIN or OUTER JOIN statement.

WORKAROUND

To work around this issue, follow these steps.

Note These steps work around the example issue that occurs when you follow the steps in the "Steps to reproduce the issue" section. To follow these steps, first follow the steps in the "Steps to reproduce the issue" section. Then follow these steps to resolve this example issue.
  1. In the database window, click New, click Create Text Scalar Function, and then click OK.
  2. In the Function pane, paste the following function:
    CREATE FUNCTION dbo.LookupUser
    (@ID int)
    RETURNS varchar(50)
    AS
    BEGIN
    DECLARE @usr varchar(50)
    SELECT @usr=UserID FROM dbo.Security Where ID=@ID and UserID=CURRENT_USER
    
    RETURN @usr
    END
  3. Click File, click Save, type LookupUser if you have to, and then click Save.
  4. On the File menu, click Close.
  5. In the database window, click the view that you saved in step 11 of the "Steps to reproduce the issue" section, and then click Design.
  6. In the SQL pane, replace the existing SQL statement with the following statement:
    SELECT OrderID, CustomerID, EmployeeID, OrderDate
    FROM dbo.Orders
    WHERE (dbo.LookupUser(EmployeeID) = CURRENT_USER)
  7. On the File menu, click Save.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the issue

  1. Start Office Access 2003, and then open the NorthwindCS.adp project.

    Note By default, the NorthwindCS.adp project is located in the \Microsoft Office\Office 11\Samples folder.
  2. Click OK.
  3. Click Display Database Window.
  4. Add a table that is named Security to the database. Create the Security table with the following details:
    • A column that has the column name ID and a data type of int
    • A column that has the column name UserID and a data type of varchar
  5. In the left pane, click Queries.
  6. In the right pane, double-click Create view in designer.
  7. On the Add Table screen, click Close.
  8. On the View menu, point to Show Panes, and then click SQL.
  9. In the SQL pane, paste the following SQL statement:
    SELECT dbo.Orders.OrderID, dbo.Orders.CustomerID, dbo.Orders.EmployeeID, 
    dbo.Orders.OrderDate
    FROM dbo.Orders INNER JOIN
    dbo.Security ON dbo.Orders.EmployeeID = dbo.Security.ID
    WHERE (dbo.Security.UserID = CURRENT_USER)
  10. On the View menu, click Properties, click to select the Update using view rules check box, and then click OK.
  11. On the File menu, click Save, type a name for the view, and then click OK.
  12. On the File menu, click Close.
  13. In the database window, double-click the view that you saved in step 11.

REFERENCES

For more information about how to resolve this issue in Microsoft Access 2002, click the following article number to view the article in the Microsoft Knowledge Base:
307925  (http://kbalertz.com/Feedback.aspx?kbNumber=307925/ ) You cannot update a view in a Microsoft Access project

APPLIES TO
  • Microsoft Office Access 2003
Keywords: 
kbpending kbtshoot kbcode kbbug KB905476
       

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

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please