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.
First we need to open ODBC in 32 mode, so let’s open in from: c:\windows\sysWOW64\odbcad32.exe
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.
Choose any driver that supports Excel format (xls)
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.
Click OK, and replace the existing DSN (64bit)
The result should be as follow:
Now we’ve managed to run the tests using Excel data source.