2

Im getting this error when connecting Excel in ODBC:

  System.Data.Odbc.OdbcException occurred
      HResult=0x80131937
      Message=ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
      Source=
      StackTrace:
    <Cannot evaluate the exception stack trace>

This is my code:

string ConnectionString = "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};Dbq=" + path + ";";
            OdbcConnection cnn = new OdbcConnection();
            cnn.ConnectionString = ConnectionString;
            cnn.Open();

I have installed this driver.

  • Possible duplicate of [Hand Install of 64-bit MS Access ODBC drivers when 32-bit Office is present](https://stackoverflow.com/questions/7116019/hand-install-of-64-bit-ms-access-odbc-drivers-when-32-bit-office-is-present) – rene Sep 16 '17 at 09:22

0 Answers0