Breaking change in ADO update KB983246 (included in Windows 7 Service Pack 1)

The Microsoft Logo

Image via Wikipedia

Update2: Microsoft fixed the issue in Windows 8 in a way that old programs would work without change. Those who recompiled with the KB983246 version either need to roll out KB983246 to customer computers or switch back to the old type libraries. New programs are encouraged to use the KB983246 version of type library when they no longer need to support computers without KB983246.

Update: please refer to the knowledge base article kb2517589 An ADO application that is re-compiled on a Windows 7 Service Pack 1-based computer does not run on down-level operating systems for walkarounds.

After installing Windows 7 SP1, which shipps with msado15.dll version:6.1.7601.17514, your ADO program may no longer work on a computer without KB983246 (msado15.dll 6.1.7600.20701).

This is caused by a problem in the old ADO type library regarding the ADO_LONG data type. Some methods’ parameters use a ADO_LONG data type whose meaning got changed to the 64bit LONGLONG on 64 bit machines. This does not adhere to the COM interface protocol as the interface used by old applications is still thinking the parameter type is LONG . I guess that’s why KB983246 suggests Office 2010 64 bit, since Office is one of the most common ADO programs on a 64 bit computer, and 64 bit Office would be more likely to be automated from 32bit COM client than other 64 bit programs.

In order to fix the compatibility issue with 64bit COM servers (including for those 32bit clients, since out-of-proc COM works across bitness), Microsoft introduced a breaking change in the ADO COM interface, changing the parameter type to ADO_LONGPTR. The complete list of changed APIs are listed at http://support.microsoft.com/kb/983246#mi. The result of the interface change causes renaming of the old interface with a postfix _deprecated and new interface IDs for the ADO interfaces. The breaking change means a “type mismatch” or 80004003 error in early binding ADO programs, when the ADO hotfix KB983246 is not installed in the user’s computer. If an IDE does early binding at compile time (e.g. VB6 programs who reference ADODB Data Controls using progids such as “Dim conn As ADODB.Connection: Set conn = New ADODB.Connection”), the compilation would fail with errors like “Class does not support Automation or does not support expected interface”.

The walkarounds suggested by Microsoft are to either upgrade customer computers with the KB983246 hotfix or switch to late binding. In addition there are programmers who remove Windows 7 SP1 or bind to an old version of the msado28.tlb file that get copied to the development machine somehow, getting around Windows’s system file protection by taking ownership of the files and grant access to administrators.

I wonder how many other LONG-based data types exist in Microsoft’s COM APIs and how Microsoft is going to fix all of them for 64bit products. Looks like there are in deed some 64bit COM issues, like The call operation fails with error code “0x800706f7” when you run an application that calls the OleCreateFromFile() function to create an embedded object from the contents of a named file in a 64-bit

DevExpress support folks had no clue when this issue was reported to them.

Known affected software:

About Sheng Jiang 蒋晟

Microsoft MVP in Visual C , 2004- Forum moderator of the Visual C and .Net forums on CSDN Forum moderator of Chinese forums on Microsoft's MSDN forums
This entry was posted in enmsdn, Microsoft, Visual C++, Visual Studio and tagged , , , , . Bookmark the permalink.

4 Responses to Breaking change in ADO update KB983246 (included in Windows 7 Service Pack 1)

  1. Pingback: More ADO issues with Windows 7 SP1: a reference count leaking when event is used | 蒋晟(JIANG,Sheng), a Microsoft MVP @Austin, Texa

  2. Pingback: ADO: No such interface supported (SP1) « Jesper Hyldenbrandt Bjerre

  3. Pingback: Another breaking change related to 64 bit compatibility, this time in TAPISRV w/Windows 8 | 蒋晟(JIANG,Sheng), a Microsoft MVP @Austin, Texa

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s