Chapter 16: Errors

OLE DB Programmer's Reference

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 "Conceptual Programming Models in OLE DB" in Chapter 1: Overview of OLE DB.

CoType TErrorObject {    [mandatory]   interface IErrorRecords; } CoType TCustomErrorObject {    [optional]   interface ISQLErrorInfo } CoType TErrorRecord {    [mandatory]   interface IErrorInfo; }

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net