Unit Test Error – ERROR [IM014] [Microsoft][ODBC Driver Manager]

28/04/2014

Visiting a customer we faced a strange problem running Coded UI with Excel Data Source:ERROR [IM014] [Microsoft][ODBC Driver Manager]

The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see “Troubleshooting Data-Driven Unit Tests” (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

The same test works on Windows 7 machines but received this error on Windows 8 64bit, So I start to investigating…

First if opened odbcad32 (from Run command), I’ve noticed the “Excel Files” DSN exists but in 64-bit platform… This is a new column in Windows 8, now because Visual Studio runs in 32-bit I’ve decided to add DSN for Excel Files in 32.

Odbcad32-64Bit

First we need to open ODBC in 32 mode, so let’s open in from: c:\windows\sysWOW64\odbcad32.exe

Odbcad32-32Bit-Location

Notice that you can’t change 64-but DSN from 32 bit, but this is the only place you can add 32-bit DSN’s.

So click Add.

Odbcad32-32Bit

Choose any driver that supports Excel format (xls)

Odbcad32-32Bit-ExcelDriver

Enter “Excel Files” and DSN name – Important to use the same name you’re using from CodedUI DataSource Attribute.

You can keep both 64 and 32 bit DSN but you’ll have to change the DSN in the Coded UI DataSource Attribute.

Odbcad32-32Bit-ExcelDriver-Excel Files

Click OK, and replace the existing DSN (64bit)

Odbcad32-32Bit-ExcelDriver-Replace

The result should be as follow:

Odbcad32-32Bit-ExcelDriver-AfterChange

Now we’ve managed to run the tests using Excel data source.

Excel Data Source

Enjoy!

Add comment
facebook linkedin twitter email

Leave a Reply