Article ID: 177939 - View products that this article applies to.
This article was previously published under Q177939
This article has been archived. It is offered "as is" and will no longer be updated.
With the release of ActiveX Data Objects (ADO) version 1.5, several minor changes have been made that may affect code when recompiled to use ADO 1.5 for Visual C++ or Visual J++. This article outlines the changes and the steps you need to take to compensate for the changes. Not all of the changes affect both Visual C++ and Visual J++; this article indicates which issues are language specific.
Adoid.lib No Longer Exists (Visual C++ - Only)With the release of the OLE DB 1.5 Software Development Kit (SDK), Microsoft no longer provides the Adoid.lib file. Instead, to link to ADO 1.5, use the code snippet below. This code snippet assumes you are not using #import or Microsoft Foundation Classes (MFC) OLE to link to ADO. If you are using #import or MFC-OLE the #include to <initguid.h> is not necessary.
You must also remove linking to the Adoid.lib in your Project's Settings dialog box or you will continue to link to ADO 1.0. If you get the following error after you remove Adoid.lib, you must define INITGUID (using #define INITGUID) on the first line of your .cpp file:
NOTE: You must install the OLE DB 1.5 Software Development Kit (SDK) to obtain the latest versions of Adoid.h and Adoint.h.
The OLE DB SDK version 1.5 released in January 1998 and is available at the following address:
http://msdn2.microsoft.com/en-gb/library/ms713643.aspxYou may also receive the following error if you build a project linking to the 1.0 Adoid.lib and including the 1.5 Headers:
LNK2005: "xxx" already defined in "yyy" errors
Extra Argument in Connection.Open() Method (Visual C++ and Visual J++)A new, reserved Options parameter was added to the Connection.Open() method. You must use a value of -1 for this argument as shown in the following code snippets. Unlike other arguments for ActiveX Data Objects (ADO), the new Options argument does not have an enumerated type within the typelib to indicate valid values.
If you use the incorrect value for this argument, the following error occurs:
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
800A0BB9 or (adErrInvalidArgument = 3001)
Extra Argument in Recordset.Requery() Method (Visual C++ and Visual J++)As with the Connection.Open() method, the Recordset.Requery method now also has a reserved parameter, whose value must be set to -1. Failure to do so generates the same error listed above (0x800A0BB9).
For additional information, please see the following articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/130869/EN-US/ )HOWTO: Avoid Error LNK2001 Unresolved External Using DEFINE_GUID
(http://support.microsoft.com/kb/182389/EN-US/ )FILE: Adovcbm.exe ADO 1.5 with #import and Getrows/Bookmarks
(http://support.microsoft.com/kb/184968/EN-US/ )FILE: Adovcsp.exe Demonstrates Using Stored Procedures with ADO
(http://support.microsoft.com/kb/186387/EN-US/ )SAMPLE: Ado2atl.exe Returns ADO Interfaces from COM
(http://support.microsoft.com/kb/181733/EN-US/ )FILE: Adovcbtd.exe #import Using UpdateBatch and CancelBatch
Article ID: 177939 - Last Review: February 24, 2014 - Revision: 3.4
Contact us for more help
Connect with Answer Desk for expert help.