The information in this article applies to:
SUMMARYThe OLE DB 1.x SDK and Data Access 2.x SDK contain two files, Adoid.h and Adoint.h, which make using ActiveX Data Objects (ADO) easier with the OLE DB SDK. This article discusses how to utilize the header files effectively. MORE INFORMATIONUsing ADOID.H and ADOINT.HFor ADO 1.x, add the \Oledbsdk\Include and \Oledbsdk\Lib folders to your path. For ADO 1.0 or 1.1 add Adoid.lib to the link step. For ADO 1.5 and later you need to explicitly remove this .lib file, and add an include to <initguid.h>, once in your application, prior to including theADOID.H/ADOINT.H file(s).You may see the following warning message upon compilation:
This message can be ignored.
Before Instantiating any ADO ObjectsIt is important to initialize OLE before creating any instances of ADO objects using the OLE SDK. You may use the following code snippet:
If you have any global BSTRs, this is also a good place to allocate and deallocate them. Error HandlingWith ADO, you may receive an error in the HRESULT returned from an ADO method. This may or may not result in errors being filled in the ADO Errors Collection. The Errors collection only receives errors raised by the underlying provider (or drivers underneath that provider.) ADO errors are not populated in the collection but can be retrieved from the IErrorInfo interface.The Adovc sample demonstrates how to catch exceptions or errors with ADO. For additional information, please see the following article in the Microsoft Knowledge Base: Q220152 Sample: ADOVC1 Simple ADO/VC++ Application Passing the License Key to ADO and ADO RedistributionADO 1.0 requires a license key when run on any system that has ADO installed in a mechanism other than a Microsoft product. If the license key is already installed in the registry, then you do not need to pass a license key. Otherwise, instead of CoCreateInstance(), you use CoGetClassObject() to get a IClassFactory2 interface and CreateInstanceLic(). ADO 1.5 removed the need for a license key.REFERENCES
"Inside COM", Dale Rogerson, Microsoft Press, February 1997, ISBN 1-57231-349-8 Q168354 INFO: Underlying OLE and OLEDB Provider Errors Exposed via ADO Additional query words: kbdse
Keywords : kbADO kbDatabase kbVC kbGrpVCDB kbGrpMDAC kbDSupport |
Last Reviewed: November 11, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |