Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I'm Converting an Excel File to CSV in one of My Report Page in an ASP.net application.
and for that im using following code

C#
var cnnStr = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;IMEX=1;HDR=NO\"", excelFilePath);
          var cnn = new OleDbConnection(cnnStr);



its working on my machine I have MS OFFICE 2013 on my system when i publish the same code on SERVER it gets me the error 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

Server doesn't have MS office Installed but it has
Microsoft Access Database Engine 2010
Microsoft Access database Engine 2007
Microsoft Access Runtime 2007

Please Help
Posted
Updated 29-Jun-15 20:54pm
v2
Comments
Herman<T>.Instance 30-Jun-15 3:13am    
Is machine 32 bit or 64 bit? There is no 64bit driver for Microsoft.Jet.OLEDB.4.0

Try this-
1. Right click on the project
2. Click Properties
3. Go to Build tab
4. Make sure that Platform Target is set to x86

As @digimanus has mentioned in comment, there is no 64 bit version of Jet. If your project is CPU (x64) specific then try using ACE 64 bit driver.

Hope, it helps :)
 
Share this answer
 
You can use Microsoft.ACE.OLEDB.12.0 for 64 bit system. You can check is it 32 bit or 64 bit system. If 32 bit then use .JET.OLEDB else use ACE.OLEDB.

You can check following link for downloading AccessDatabaseEngine
http://www.microsoft.com/download/en/details.aspx?id=13255
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900