locked
unable to upload excel on ASP.NET MVC application RRS feed

  • Question

  • User1514739677 posted

    Hi all,

    I am an IIS admin. In our organization, we are using a ASP.NET MVC application. In that application, we use to frequently upload excel file.

    When we upload the excel file, most of the time we use to receive one of the following errors.

    1) The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. The uploaded file may not be in correct format! please use the template.

    2) Error Message:System.Data.OleDb.OleDbException (0x80004005): System resource exceeded.

    3) Error Message:System.Data.OleDb.OleDbException (0x80004005): External table is not in the expected format.

    The application is hosted on windows server 2012 (IIS 8.0) 64-bit, the database is SQL Server 2012 and we use to upload files of 50 MB size. At one particular time, maximum of 5 files can be uploaded.

    We tried below options to fix the issues,

    1) First we installed "Microsoft office Access database engine 2007(32 bit)" alone and then "Microsoft Access database engine 2010(64 bit) alone, and both the drivers.

    2) In the Application Pool's Advanced settings changed the "Enable 32-bit Applications" setting as "True".

    3) In the Application Pool's Advanced settings changed the "Load User Profile" setting as "True".

    But, no one of the above gave us solution.

    Kindly help us in fixing this issue.

    Thanks in advance,

    Regards,

    K.P.Senthil Kumar

    Wednesday, October 21, 2015 5:49 AM

Answers

  • User-821857111 posted

    The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
    If you have enabled 32 bits applications, your web app is now 32 bit and needs either the 2007 driver (which is only available as 32 bit) or the 32 bit version of the 2010 driver. You should also check to see if the app targets Any CPU, which will allow it to run as 32 bit or 64 bit. If you are targeting 64 bit, you need the 2010 64 bit provider.

     

    The uploaded file may not be in correct format!
    That's not an error message I recognise. You should attempt to identify what circumstances generate that error message. 

    Are your "Excel" files .xls files that have been generated by the application as some kind of Export from Gridview feature? If so, it could well be that they are actually HTML files with a .xls extension. Excel will display the contents, but the ACE and JET providers will not recognise them.

    http://www.mikesdotnetting.com/article/280/solved-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-mac

    http://www.mikesdotnetting.com/article/278/a-better-way-to-export-gridviews-to-excel

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 22, 2015 2:43 AM