Like any other VB error, SQL Server errors can be trapped with the On Error statement. In addition to the VB Err object, the ADO Connection object has an Errors collection. This collection can be looped through with a For Each, Next construction. Your application can respond not to only referential integrity errors with the Errors collection but to many other SQL Server errors as well, such as locking and connecting errors.