Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Table in a Microsoft Access Project Cannot Be Updated


View products that this article applies to.

This article was previously published under Q235267
Moderate: Requires basic macro, coding, and interoperability skills.

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

↑ Back to the top


Symptoms

You find that you cannot delete, update, or insert new records in a table in an Access project.

↑ Back to the top


Cause

The table does not have a unique index.

↑ Back to the top


Resolution

To work around this behavior, check that the table has a unique index. If the table does not have a unique index, create a unique index by using a stored procedure such as the one in the "How to Correct the Behavior" section that follows step 4 of the "Steps to Reproduce Behavior" section later in this article.

↑ Back to the top


More information

CAUTION: If you follow the steps in this example, you modify the sample Access project NorthwindCS.adp. You may want to back up the NorthwindCS.adp file and follow these steps on a copy of the project.

Steps to Reproduce Behavior

  1. Open the sample Access project, NorthwindCS.adp.
  2. In NorthwindCS.adp, create the following stored procedure, and then run it:
    Create Procedure "MakeTestTable"

    As

    SELECT * INTO tblTest FROM customers

    CREATE INDEX tblTest_Index ON tblTest (customerid)

    return
  3. In the Database window, click Tables, and then press F5 to refresh the Tables list.
  4. Open the tblTest table in Datasheet view. Note that when you open the table in Datasheet view, you cannot edit or add records.

How to Correct the Behavior

You can correct this behavior by running the following stored procedure:
Create Procedure "FixTestTable"

As

DROP INDEX tblTest.tblTest_Index

CREATE UNIQUE INDEX tblTest_Index ON tblTest (customerid)

return

↑ Back to the top


Keywords: KB235267, kbusage, kbclientserver, kbprb

↑ Back to the top

Article Info
Article ID : 235267
Revision : 2
Created on : 6/30/2004
Published on : 6/30/2004
Exists online : False
Views : 299