Article ID: 2517589 - Last Review: January 17, 2012 - Revision: 7.0 An ADO application does not run on down-level operating systems after you recompile it on a computer that is running Windows 7 SP 1 or Windows Server 2008 R2 SP 1 or that has KB983246 installed
Caution ADO and ADO MD have not been fully tested in a Microsoft .NET Framework environment. They may cause intermittent issues, especially in service-based applications or in multithreaded applications. The techniques that are discussed in this article should only be used as a temporary measure during migration to ADO.NET. You should only use these techniques after you have conducted complete testing to make sure that there are no compatibility issues. Any issues that are caused by using ADO or ADO MD in this manner are unsupported. For more information, see the following article in the Microsoft Knowledge Base: 840667
(http://support.microsoft.com/kb/840667/
)
You receive unexpected errors when using ADO and ADO MD in a .NET Framework application On This PageSYMPTOMSConsider the following scenario. On a computer that is running Windows 7 Service Pack 1 (SP1) or Windows Server 2008 R2 SP 1 or that has KB9823246 installed, you recompile a Microsoft ActiveX Data Objects (ADO) application by using one of the following applications:
Error message 1 REGDB_E_CLASSNOTREG (0x80040154) E_POINTER (0x80004003) E_NOINTERFACE (0x80004002) Unable to cast COM object of type 'System.__ComObject' to interface type 'ADODB.Connection'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00001550-0000-0010-8000-00AA006D2EA4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).” Note Microsoft no longer supports the primary interop assembly for ADO and no longer supports Visual Basic 6. For more information about Visual Basic 6 supportability, visit the following MSDN webpage: Support Statement for Visual Basic 6.0 on Windows Vista, Windows Server 2008 and Windows 7
(http://msdn.microsoft.com/en-us/vbasic/ms788708.aspx)
For more information about the primary interop assembly for ADO supportability, click the following article number to view the article in the Microsoft Knowledge Base: 318559
(http://support.microsoft.com/kb/318559/
)
Using the primary interop assembly for ADO (ADODB) in Visual Studio .NET CAUSEThis issue occurs because some ADO interfaces were changed in Windows 7 SP1 to be associated with new instance identifiers (IIDs). The older IID interfaces were assigned the following suffix: _Deprecated For example, the interface _Connection was updated as follows:
Some ADO APIs are platform-dependent in ADO 2.7 and in later versions. On 64-bit versions of Windows, these ADO APIs process arguments by using a 64-bit data type (such as the LONGLONG data type). However, applications that use these APIs still use the LONG data type. Therefore, you receive a "Type Mismatch" error message when you try to run the macro. WORKAROUNDTo work around this issue, use one of the following methods. Method 1To work around this issue for Visual C++ applications, for Visual Basic 6 applications, and for Microsoft .NET applications, follow these steps.Notes
For 32-bit computers
For AMD 64 computers
For IA64 computersUse the same procedure as for AMD64 computers, but download Msado60_Backcompat_ia64.tlb instead of Msado60_Backcompat_x64.tlb.Downloads
For C++ developers
For Visual Basic 6 developers
Method 2You can change your application so that it uses late binding. For example, you would call the ADO APIs through the IDispatch interface in C++.Note This workaround does not apply to Visual Basic for Applications applications. MORE INFORMATIONThe following is a complete list of interfaces that have the old IID together with the suffix "_Deprecated" that is added to the interface name:
http://blogs.msdn.com/b/psssql/archive/2011/10/03/yes-we-made-a-mistake-and-are-finally-going-to-fix-it.aspx
(http://blogs.msdn.com/b/psssql/archive/2011/10/03/yes-we-made-a-mistake-and-are-finally-going-to-fix-it.aspx)
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top