« PreviousNext »

Excel ODBC Driver for Windows Server 2008 (64 Bit)

10 June 2008

So I’m running Windows Server 2008 as a development workstation. I ran into some trouble with a custom .NET application that imports data from Excel files using the ODBC driver.

Error Message in .NET

ERROR [IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified

We are using this ODBC connection string (found on connectionsstrings.com):

Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\MyExcel.xls;DefaultDir=c:\mypath;

After much research on the issue, it turns out the Excel ODBC drivers are 32 bit. So you need to change your Visual Studio platform to be x86 (to force 32bit) … mine was set to “Any CPU”

From what I can gather about the issue here, is that if your application is running in 64 bit mode, then when it creates an odbcConnection, that will also be running under 64 bit (makes sense so far) … so for any drivers that you have that are 32 bit they will not be accessible. Thus you get an error stating “data source name not found”

see this forum post about running sql server 2005 64 bit … it doesn’t say anything about Excel, but I think the principle applies

That’s it! Hope this helps.

For some light ;) reading on Windows Server 2008

Posted in .NET Programming | Trackback | del.icio.us | Top Of Page

No comments yet

Leave a Reply


You must be logged in to post a comment.