Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel reading in asp.net

Posted on 2013-02-07
9
Medium Priority
?
379 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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

705 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