Errors

 

System_CAPS_ICON_warning.jpg Warning

SQL Server Native Client (SNAC) is not supported beyond SQL Server 2012. Avoid using SNAC in new development work, and plan to modify applications that currently use it. The Microsoft ODBC Driver for SQL Server provides native connectivity from Windows to Microsoft SQL Server and Microsoft Azure SQL Database.

OLE/COM objects report errors through the HRESULT return code of object member functions. An OLE/COM HRESULT is a bit-packed structure. OLE provides macros that dereference structure members.

OLE/COM specifies the IErrorInfo interface. The interface exposes methods such as GetDescription. This allows clients to extract error details from OLE/COM servers. OLE DB extends IErrorInfo to support the return of multiple error information packets on a single-member function execution.

SQL Server can return multiple errors. An application can retrieve server errors one at a time by calling IMultipleResults::GetResult combined with ISQLErrorInfo and IErrorRecords.

The SQL Server Native Client OLE DB provider exposes the OLE DB record-enhanced IErrorInfo, the custom ISQLErrorInfo, and the provider-specific ISQLServerErrorInfo error object interfaces.

For information about tracing errors, see Data Access Tracing. For information about enhancements to error tracing added in SQL Server 2012, see Accessing Diagnostic Information in the Extended Events Log.

SQL Server Native Client (OLE DB)

Community Additions

ADD
Show: