MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 16: Errors
This chapter addresses the ability of OLE DB to process errors by using methods that either return a code or create an error object. Error objects can return detailed error information. Handling of multiple error items is discussed in the section "Arrays of Errors," later in this chapter.
The mechanics of how an Automation component returns and/or retrieves an error object, as well as its use of threads, is presented here. OLE DB extends Automation error objects by adding the ability for an error object to contain multiple error records. Provider-specific error lookup services are also discussed.
For more information on | Go to |
Return codes | "Return Codes" in this chapter |
Arrays of errors | "Arrays of Errors" in this chapter |
How an Automation component returns an error object | "How an Automation Component Returns an Error Object" in this chapter |
How an Automation consumer retrieves an error object | "How an Automation Consumer Retrieves an Error Object" in this chapter |
OLE DB error objects | "OLE DB Error Objects" in this chapter |
Error object example | "Error Object Example" in this chapter |
Error records | "Error Records" in this chapter |
Error record example | "Error Record Example" in this chapter |
Interfaces used by OLE DB error objects | "Interfaces Used by OLE DB Error Objects" in this chapter |
How a provider returns an error object | "How a Provider Returns an OLE DB Error Object" in this chapter |
How a consumer retrieves an error object | "How a Consumer Retrieves an OLE DB Error Object" in this chapter |
Use of threads | "OLE DB Error Objects and Threads" in this chapter
"Threading and Error Objects" in Chapter 18, "Programming Considerations" |
Provider-specific error lookup services | "Error Lookup Services" in this chapter
"Error Lookup Service Registry Entries" in Chapter 18, "Programming Considerations" |
Methods return error information in two ways. The value returned by a method indicates the overall success or failure of the method. Error objects provide detailed information about the error, such as text describing the error, the Help file containing information about the error, a text description of the program that was the source of the error, and any provider-specific error information. Error objects in OLE DB are an extension of the error objects in Automation, use many of the same mechanisms, and can be used as Automation error objects.
The error object, custom error object, and error record object cotypes are defined as follows. For more information about cotypes, see "OLE DB Objects" in Chapter 1, "Overview of OLE DB."
CoType TErrorObject {
[mandatory] interface IErrorRecords;
}
CoType TCustomErrorObject {
[optional] interface ISQLErrorInfo
}
CoType TErrorRecord {
[mandatory] interface IErrorInfo;
}