Returns a pointer to a SQLOLEDB SSERRORINFO structure containing Microsoft® SQL Server™ error detail.
HRESULT GetErrorInfo(
SSERRORINFO**ppSSErrorInfo,
OLECHAR**ppErrorStrings);
SQLOLEDB allocates memory for the SSERRORINFO and OLECHAR strings returned through the pointers passed by the consumer. The consumer must deallocate this memory by using IMalloc::Free when it no longer requires access to the error data.
The SSERRORINFO structure is defined as follows:
typedef struct tagSSErrorInfo
{
LPOLESTR pwszMessage;
LPOLESTR pwszServer;
LPOLESTR pwszProcedure;
LONG lNative;
BYTE bState;
BYTE bClass;
WORD wLineNumber;
}
SSERRORINFO;
Member | Description |
---|---|
pwszMessage | Error message from SQL Server. The message is returned through the IErrorInfo::GetDescription method. |
pwszServer | Name of the SQL Server installation on which the error occurred. |
pwszProcedure | Name of the stored procedure generating the error if the error occurred in a stored procedure. Otherwise, an empty string. |
lNative | SQL Server error number. The error number is identical to that returned in the plNativeError parameter of the ISQLErrorInfo::GetSQLInfo method. |
bState | State of a SQL Server error. |
bClass | Severity of a SQL Server error. |
wLineNumber | When applicable, the line of a SQL Server stored procedure that generated the error message. The default value if there is no procedure involved is 1. |
Pointers in the structure reference addresses in the string returned in ppErrorStrings.