ACC1x: SQL Delete Triggers Function IncorrectlyLast reviewed: May 20, 1997Article ID: Q99404 |
The information in this article applies to:
SYMPTOMSMicrosoft Access appears to delete a record in an attached SQL table, but the record is not actually deleted. The record will reappear when you requery the table.
CAUSEThe Microsoft SQL Server driver that comes with Microsoft Access version 1.0 incorrectly indicates that the result of the SQL delete action is successful.
RESOLUTIONTo correct this problem, you must DROP the current trigger and CREATE a new delete trigger on the SQL Server that uses the RAISERROR command instead of the PRINT command. This method causes Microsoft Access version 1.0 to not delete the record and display the following error messages:
ODBC - delete failed. [Microsoft][ODBC SQL Server Driver][SQL Server] <MESSAGE> (#-31073)where <MESSAGE> is the message you specified in the RAISERROR command.
STATUSMicrosoft has confirmed this to be a problem in Microsoft Access version 1.0. This problem was corrected in Microsoft Access version 1.1.
MORE INFORMATIONIf you try to delete a record from an attached SQL table that has a delete trigger that performs a ROLLBACK and a PRINT action on the SQL Server, Microsoft Access version 1.0 appears to delete the record and then displays a message box asking you to verify your deletion. The record is actually not deleted and reappears when you requery the table by pressing SHIFT+F9, choosing Show All Records from the Records Menu, or closing and reopening the table. In Microsoft Access version 1.1, the RAISERROR method works the same way that it does in version 1.0. The PRINT method works similarly to the way it does in version 1.0. In version 1.0, the PRINT method appears to let you delete the record without a warning, then later the record reappears. In version 1.1, the PRINT method still does not display the message specified by the PRINT command; however, it does not remove the record, and it does display the following error message:
ODBC - call failed. Steps to Reproduce Problem
REFERENCES"Microsoft SQL Server Language Reference," version 4.2, pages 88-93, 137, 203-204, and 214-216
|
Additional query words: ODBC
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |