Wednesday, May 30, 2012

Upgrading the Data Access Components for Analysis Services from Windows XP to Windows 7

I had a project where I needed to upgrade a .NET web application.

Before the upgrade, it had the following environment:
  • Development: Visual Studio 2003, Windows XP
  • Production: SQL Server 2000, Analysis Services 2000, Windows Server 2003
  • Data Access: Microsoft Data Access Components 2.8 (MDAC 2.8) 

After the upgrade, it had the following environment:
  • Development: Visual Studio 2008, Windows 7
  • Production: SQL Server 2008, Analysis Services 2008, Windows Server 2008
  • Data Access: Windows Data Access Components 6.0 (WDAC 6.0)

The first thing that you need to know is that MDAC 2.8 has been renamed to WDAC 6.0. While MDAC needed to be installed separately, WDAC is a core component of Windows Vista and later operating systems, which means there is no separate distributable for installing WDAC. In trying to minimize any potential code changes, I initially tried to reuse MDAC 2.8 by copying Interop.ADODB.dll and Interop.ADOMD.dll to the new environment and added them as references in my projects, but I got the following error:

The project currently contains references to more than one version of Interop.ADODB, a direct reference to version 2.8.0.0 and an indirect reference (through 'ADOMD.Member.Properties') to version 6.0.0.0. Change the direct reference to use version 6.0.0.0 (or higher) of Interop.ADODB.

I couldn't find anything on the web on how to fix this error, so after several hours of trying to get this to work, I decided that it would take less effort to just use WDAC instead. But it took me a few more hours of research to finally figure out how to add references to the new WDAC DLL's.

  1. Select the Build -> Clean Solution menu
  2. Delete all instances of Interop.ADODB.dll and Interop.ADOMD.dll in all the project directories (usually in the obj or obj/Debug folders).
  3. For each project that uses the old MDAC 2.8 components, replace references to Interop.ADODB.dll to msado15.dll by right clicking on the project -> Add Reference, click on the COM tab, and look for Microsoft ActiveX Data Objects 6.0 Library as shown by the first highlighted line below.
  4. For each project that uses the old MDAC 2.8 components, replace references to Interop.ADOMD.dll to msadomd.dll by right clicking on the project -> Add Reference, click on the COM tab, and look for Microsoft ActiveX Data Objects (Multi-dimensional) 6.0 Library as shown by second highlighted line below.
  5. Do a full rebuild of the projects and all data access related code should magically compile without any code changes.





No comments:

Post a Comment