Microsoft KB Archive/94598

{|
 * width="100%"|

ACC1x: Incorrect Action Query Message Box Text

 * }

Q94598

-

The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1

-

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 record(s) were deleted, record(s) were lost due to key violations and 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:

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
  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  Create a one-to-many relationship between Table1 and Table2, with ID as the matching field. Enforce referential integrity rules. Add two records to each table.  Create the following query based on Table1:

     Query: Query1 -     Field: ID      Field: Name  Change Query1 from a select query to a delete query by choosing Delete from the Query menu. Run Query1 by choosing Run from the Query menu. Choose the OK button to delete the records.</li></ol>

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

Issue type : kbbug

Technology :