ACC1x: SQL Delete Triggers Function IncorrectlyID: Q99404
|
Microsoft 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.
The Microsoft SQL Server driver that comes with Microsoft Access version 1.0 incorrectly indicates that the result of the SQL delete action is successful.
To 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)
Microsoft has confirmed this to be a problem in Microsoft Access version 1.0. This problem was corrected in Microsoft Access version 1.1.
If 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.
"Microsoft SQL Server Language Reference," version 4.2, pages 88-93, 137, 203-204, and 214-216
Additional query words: ODBC
Keywords : kbusage OdbcOthr
Version : 1.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: March 23, 1999