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.
- In the database window, click New, click
Create Text Scalar Function, and then click
OK.
- 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
- Click File, click Save,
type LookupUser if you have to, and then click
Save.
- On the File menu, click
Close.
- 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.
- 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)
- 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
- 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. - Click OK.
- Click Display Database Window.
- 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
- In the left pane, click
Queries.
- In the right pane, double-click Create view in
designer.
- On the Add Table screen, click Close.
- On the View menu, point to Show
Panes, and then click SQL.
- 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)
- On the View menu, click
Properties, click to select the Update using view
rules check box, and then click OK.
- On the File menu, click
Save, type a name for the view, and then click
OK.
- On the File menu, click
Close.
- 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
| 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