"Load Data from Excel with Odbc" doesn't work in Unity 5 64bit

This works perfectly in Unity 4.6 32bit:


But Unity 5 64bit throws exception:

// Must be saved as excel 2003 workbook, not 2007, mono issue really
string con = "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790; Dbq="+filetoread+";";
string yourQuery = "SELECT * FROM [Sheet1$]"; 
// our odbc connector 
OdbcConnection oCon = new OdbcConnection(con); 
// our command object 
OdbcCommand oCmd = new OdbcCommand(yourQuery, oCon);
// table to hold the data 
DataTable dtYourData = new DataTable("YourData"); 
// open the connection 

The last line throws exception:

OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
System.Data.Odbc.OdbcConnection.Open ()

I have downloaded and installed Microsoft Access Database Engine 2010 Redistributable

But it still does not work.

Does anyone know a solution? Thank you!

Check the installed ODBC Drivers on your machine. Install the 64 bit version or use the 32 bit Unity version to use the 32 bit ODBC driver.

More info can be found here: Unity-Forum

Kind regards.

JinJin @centaurianmudpig :

I have a problem like you too and try to follow your advice but I really don’t understand some point :

  • add excel.dll ( where can I find it ? )

  • Change unity project settings from using “.net 2 subset” to using".net 2"( I can’t to find it in my ProjectSettings folder in my project).

So that Can you detail me more about it?

Oh… one thing I use Unity 5.1.2 p1(64 Bit) and Excel 2010.
Thank you !

you can use Uni-Excel Package for Read, Write, and edit excel files