MDAC 2.5 SDK - OLE DB Providers
OLE DB Provider for SQL Server


 

Information in OLE DB Error Interfaces

SQLOLEDB reports some error and status information in the OLE DB-defined error interfaces IErrorInfo, IErrorRecords, and ISQLErrorInfo.

SQLOLEDB supports IErrorInfo member functions as described in the following table.

Member function Description
GetDescription Descriptive error message string.
GetGUID GUID of the interface that defined the error.
GetHelpContext Not supported. Returns zero always.
GetHelpFile Not supported. Returns NULL always.
GetSource String Sqloledb.dll.

SQLOLEDB supports consumer-available IErrorRecords member functions as described in the following table.

Member function Description
GetBasicErrorInfo Fills an ERRORINFO structure with basic information about an error. An ERRORINFO structure contains members that identify the HRESULT return value for the error, and the provider and interface on which the error applies.
GetCustomErrorObject Returns a reference on interfaces ISQLErrorInfo and ISQLServerErrorInfo.
GetErrorInfo Returns a reference on an IErrorInfo interface.
GetErrorParameters SQLOLEDB does not return parameters to the consumer through GetErrorParameters.
GetRecordCount Count of error records available.

SQLOLEDB supports ISQLErrorInfo::GetSQLInfo parameters as described in the following table.

Parameter Description
pbstrSQLState Returns a SQLSTATE value for the error. SQLSTATE values are defined in the SQL-92, ODBC and ISO SQL, and API specifications. Neither Microsoft® SQL Server™ nor SQLOLEDB define implementation-specific SQLSTATE values.
plNativeError Returns the SQL Server error number from master.dbo.sysmessages when available. Native errors are available after a successful attempt to initialize a SQLOLEDB data source. Prior to the attempt, SQLOLEDB always returns zero.