ACC2000: Unexpected Error with Cascading Deletes in an Access Project (269379)
The information in this article applies to:
This article was previously published under Q269379 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
In an Access project, when you try to delete a record from a table, you receive one of the following error messages.
If you are using SQL Server:
Insufficient or incorrect key column information; too many rows affected by update.
If you are using the Microsoft Data Engine (MSDE):
Key column information is insufficient or incorrect. Too many rows were affected by update.
Then you see that the record that you deleted still appears in the table. After you refresh the table or close and then re-open the table, you see that the record was actually deleted.
CAUSE
The table that you deleted the record from contains a cascading delete, and there are two or more matching records in the other table or tables that the trigger acts upon.
RESOLUTION
To work around this behavior, follow these steps:
- Create a form based on the one-sided table. If you want to, you can make the form default to Datasheet view in the form's property sheet by changing the DefaultView property on the Format tab.
- Click Code on the View menu.
- Type or paste the following code:
Option Compare Database
Option Explicit
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Response = acDataErrContinue
Me.Requery
End Sub
Now when you delete a record in the form, you will not receive an error message, and the screen will be refreshed.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/25/2004 |
---|
Keywords: | kbbug kberrmsg kbnofix KB269379 |
---|
|