ODBC error messages normally consist of two components. The first component
is error 3146, whose description is:
ODBC--Call failed
The server-specific error information is contained in the second component,
from which you can retrieve an error number and a description such as:
[Microsoft][ODBC SQL Server Driver][SQL Server] <Server-specific error message> (#<error number>)
If you set the
OnError property of a form to an event procedure, you can
trap the number of the first component of the error, but you cannot trap
the number of the second component. The server-specific information in the second part of the ODBC error appears on the screen after the code has finished running, unless you include the following line in the event procedure:
Response = acDataErrContinue
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.