OLE DB Programmer's Reference |
Adds a record to an OLE DB error object.
HRESULT AddErrorRecord ( ERRORINFO *pErrorInfo, DWORD dwLookupID, DISPPARAMS *pdispparams, IUnknown *punkCustomError, DWORD dwDynamicErrorID);
Parameters
const DWORD IDENTIFIER_SDK_MASK = 0xF000000; const DWORD IDENTIFIER_SDK_ERROR = 0x1000000;
If the error lookup service uses dynamic errorsthat is, error information that is created at run timedwDynamicErrorID is the ID of the error record. This ID is used to release the error information when the OLE DB error object is released. Although it is not required, it is more efficient for all error records in a single OLE DB error object to have the same dynamic error ID.
For more information, see "Error Lookup Services" in Chapter 16: Errors.
Return Code
Comments
This method should be used only by providers; there are no reasons for consumers to use it.
Records are added to the top of the list. That is, the number of the newly added record is record 0 and the number of all other records is increased by 1.
IErrorRecords::AddErrorRecord adds a reference count on the custom error object. After adding a custom error object to a record in an OLE DB error object, the provider must call Release on all interface pointers it holds on that custom error object. This transfers ownership of the custom error object to the OLE DB error object. When it is released, the OLE DB error object will release all custom error objects.
IErrorRecords::GetBasicErrorInfo | IErrorRecords::GetCustomErrorObject | IErrorRecords::GetErrorParameters
1998-2001 Microsoft Corporation. All rights reserved.