Solved

Excel reading in asp.net

Posted on 2013-02-07
9
365 Views
Last Modified: 2013-02-14
Hello Experts!

I have attached the code but I am finding the following issue when I host this on the IIS 7 on the Windows Server Standard FE Service Pack 2

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

The problem is coming because of the following:
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileLocation + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";

I did enable 32 bit true of the application pool assigned but then it gets to the  following problem:

The requested page cannot be accessed because the related configuration data for the page is invalid.

Thanks
meetDinesh
Test.zip
0
Comment
Question by:Dinesh Kumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 38866672
What exact OS version are you using?
You may need to reinstall Microsoft.Jet.OLEDB.4.0 driver,  check:
http://stackoverflow.com/questions/1991643/microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine

Also you need to recompile your site as 32 bit (x86) application.
0
 

Author Comment

by:Dinesh Kumar
ID: 38866886
OS Version: Windows Server Standard FE Service Pack 2

I tried to install http://www.microsoft.com/en-us/download/details.aspx?id=13255

but it says  I need to uninstall 32 drivers first from the Server, I don't know how to uninstall that that.
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 38870071
What it means is that driver is actually installed, thus no need to install anything.
If that is the case you should recompile your site as 32 bit (x86) application and configure IIS app pool site to run 32 bit apps:
- Open IIS
- Change the appPool on Advanced Settings to true to enable to 32-bit application.

If the above does not solve and you still has the requested page access error message, you may have permission issues or your web.config files is corrupted, check:
 http://stackoverflow.com/questions/9216158/the-requested-page-cannot-be-accessed-because-the-related-configuration-data-for
http://social.msdn.microsoft.com/Forums/eu/wcf/thread/3bccf307-3ed2-49e5-aa83-e18abcb3385a
0
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

Author Comment

by:Dinesh Kumar
ID: 38871064
If I do enable to 32-bit application:

then the problem becomes the following:

http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Microsoft_IIS/Q_28022154.html
0
 

Author Comment

by:Dinesh Kumar
ID: 38871066
and if do enable 32 bit application as false then:

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

Author Comment

by:Dinesh Kumar
ID: 38871182
I tried installing 64 bit on the 64 machine i.e on the Server and I found the attached error.
error-1-.png
0
 

Accepted Solution

by:
Dinesh Kumar earned 0 total points
ID: 38871631
I resolved the following error
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

by installing the AccessDatabaseEngine_x64.exe on http://www.microsoft.com/en-in/download/details.aspx?id=13255

but because the server is 64 bit so I have to uninstall the 32 bit based Office 2007 from the Server.

Moreover I used only Microsoft.ACE.OLEDB.12.0 (for 64 bit)  instead of Jet.OleDB.4.0 (32 bit)

Yes we can force Jet OleDB to run on 64 bit by enabling 32 bit true forcefully but it was  not required as I used ACE.OLEDB.12.0
0
 

Author Closing Comment

by:Dinesh Kumar
ID: 38888279
I myself resolved after a long time :-(
0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question