0

I am getting an error The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. the code works locally but not remotely. Due to restrictions on remote hosting environment I wonder if the code below can be amended to use NetOffice.Excel.Net40:

OleDbConnection conn;
conn = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + filename + ";Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1;\"");
conn.Open();

var tblSchema = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });

Can anyone please help?

iggyweb
  • 2,373
  • 12
  • 47
  • 77

1 Answers1

0

If you are on a 64 bit machine you will need to use Microsoft.ACE.OLEDB.12.0 instead of Jet.

MikeV
  • 585
  • 3
  • 11
  • Unfortunately that resource isn't available either, I need to be able to include a reference to my project so that I can publish the dependency so that it is available on the remote host, irrespective of installed drivers. I came across NetOffice.Excel.Net40, but struggling to find a an example for reading from an Excel spreadsheet. – iggyweb Jul 31 '14 at 07:50