1

My local PC is installed with Windows7 64bit and Microsoft Excel 2010 But most of my clients' PC are XP Professional Service Pack 3 and Excel 2003

I got this connection string for import data of Excel file

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

But this throws an error saying that

The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

I want my application can read Excel file on both, x86 and x64, architectures. How can i handle this programmatically without installing extra Excel driver on PC?

I'm thinking to use different connection strings for importing Excel files based on CPU archtiecture.

Is there any better idea?

SiHyung Lee
  • 349
  • 3
  • 8
  • 25

2 Answers2

3

Make sure you have installed the Jet driver that supports both x86 and x64 on your development system.

Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553
0

This is because of a mismatch between compilation configuration in Visual Studio and the ACE version installed on the system. (Ref: How to read or write excel file using ACE OLEDB data provider?.)

You can resolve it by making sure that both are same. Compile your app using the x64 bits if 64-bit ACE is installed or use 32-bit ACE.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Sunil Singhal
  • 593
  • 3
  • 11