Overview of Errors

This chapter addresses the ability of OLE DB to process errors by using methods, which either return a code or create an error object. Error objects, which are a basic OLE DB component, can return detailed error information. Handling of multiple error items is discussed under "Arrays of Errors."

Automation is the ability to expose one software application's services to another application by using interfaces, such as COM. 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
Basic OLE DB components "OLE DB Components" in Chapter 1, "Overview of OLE DB"
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 records "Error Records" in this chapter
Interfaces used by OLE DB error objects "Interfaces Used by OLE DB Error Objects" in this chapter
How an Automation component returns an error object "How a Provider Returns an OLE DB Error Object" in this chapter
How an Automation component 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 14, "Programming Considerations"

Provider-specific error lookup services "Error Lookup Services" in this chapter

"Error Lookup Service Registry Entries" in Chapter 14, "Programming Considerations"

Consumers and providers "Consumers and Providers" in Chapter 1, "Overview of OLE DB"

Methods return error information in two ways. The code returned by a method indicates the overall success or failure of the method, and 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.

Errors:

CoType TErrorObject {
   [mandatory] interface IErrorRecords;
}

Custom errors:

CoType TCustomErrorObject {
   [optional]  interface ISQLErrorInfo
   [optional]  interface IErrorLookup;
}

Error records:

CoType TErrorRecord {
   [mandatory] interface IErrorInfo;
}