ACC1x: Incorrect Action Query Message Box Text

ID: Q94598


The information in this article applies to:


SYMPTOMS

An error message generated by an action query (that is, a delete, make-table, update, or append query) may contain the following incorrect message box text:

Errors were encountered: The contents of fields in <number> record(s) were deleted, <number> record(s) were lost due to key violations and <number> record(s) were locked and couldn't be modified. Proceed anyway?


CAUSE

This problem is caused by the way Microsoft Access handles errors for action queries. Microsoft Access uses the same error message for every action query instead of using a separate error message for each type of action query.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.


MORE INFORMATION

The portion of the above error message that reports key violations:

<number> record(s) were lost due to key violations

becomes active whenever referential integrity is violated during a query. However, this specific information only applies to Append and Make Table queries. If an update or delete query violates referential integrity, this portion of the error message erroneously gives the impression that records have been lost, when in fact they simply were not updated or deleted.

Steps to Reproduce Problem


  1. Create the following two tables:
    
          Table: Table1
          ---------------------------
          FieldName: ID  [PrimaryKey]
             DataType: Text
          FieldName: Name
             DataType: Text
    
          Table: Table2
          -----------------
          FieldName: ID
             DataType: Text
          FieldName: Hobby
             DataType: Text 


  2. Create a one-to-many relationship between Table1 and Table2, with ID as the matching field. Enforce referential integrity rules.


  3. Add two records to each table.


  4. Create the following query based on Table1:
    
          Query: Query1
          -------------
          Field: ID
          Field: Name 


  5. Change Query1 from a select query to a delete query by choosing Delete from the Query menu.


  6. Run Query1 by choosing Run from the Query menu.


  7. Choose the OK button to delete the records.


The following error message is displayed:
Errors were encountered: The contents of fields in 0 record(s) were deleted, 2 record(s) were lost due to key violations and 0 record(s) were locked and couldn't be modified. Proceed anyway?

This message correctly identifies that there were key violations (because of referential integrity), but it incorrectly indicates the loss of two records. In actuality, the records were not modified and therefore not lost.


Keywords          : kberrmsg kbusage QryMktbl 
Version           : 1.0 1.1
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: March 13, 1999