For errors that occur in the data source (returned by Microsoft® SQL Server™), the SQL Server ODBC driver returns the native error number returned to it by SQL Server. For errors detected by the driver, the SQL Server driver returns a native error number of 0. For more information about a list of native error numbers, see the error column of the sysmessages system table in the master database in SQL Server.
For errors returned by the Net-Library, the native error number is from the underlying network software.
For errors returned by Microsoft Windows NT® or Microsoft Windows® 95, the SQL Server ODBC driver calls the Microsoft Win32® GetLastError function and returns that error as the native error.
To process ODBC errors