Geeks With Blogs

News View Michael Stephenson's profile on BizTalk Blog Doc View Michael Stephenson's profile on LinkedIn
Michael Stephenson keeping your feet on premise while your heads in the cloud

Just a little quick one for myself....

When running some data driven unit tests we were getting the below error.

Unit Test Adapter threw exception: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

The cause of this was that we had rebuild the machines and somehow when installing office the DSN for Excel hadnt been created.  On all of the other machines it had been setup fine but for some reason on my machine it hadnt been setup. 

The fix was to create a DSN called Excel Files pointing to excel drivers and then just rerun the unit tests.

As a reminder the test attributes for this were below:

[TestMethod][DeploymentItem(@"..\..\..\mappings.xlsx")]

[DataSource("System.Data.Odbc", "Dsn=Excel Files;dbq=|DataDirectory|\\spreadsheet.xlsx", "worksheet1$", DataAccessMethod.Sequential)]

Posted on Friday, November 12, 2010 2:50 PM | Back to top


Comments on this post: Data Driven Unit Test - Excel DSN Error

# re: Data Driven Unit Test - Excel DSN Error
Requesting Gravatar...
nice and useful blog
Scorpio love Horoscope thansk
Left by ruby singh on Apr 21, 2017 7:11 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Stephenson | Powered by: GeeksWithBlogs.net