none
Error occurs (at random) when we trying to open an XLSX file RRS feed

  • Question

  • Hi!

    Sometimes when we trying to open a XLSX file with provider “Microsoft.ACE.OLEDB.12.0” an error occurs and our process simply crash on line “Connection.Open” without catch any exception. We see these errors in windows event log at the same times: See Complete Event Log 1 and Complete Event Log 2 section

    These errors occurs in x86 mode and in x64 mode is the same patterns. Sometimes, “Connection.Open” on an XLSX file work properly and we don’t have any procedures or clues to reproduce this problem. 

    OS: Windows 2008 SP2 x64
    IE: 7.0.6002.18005
    Microsoft.Net Framework (x86): V1.0.3705, V1.1.4322, V2.0.50727, V3.0, V3.5, V4.0.30319
    Microsoft.Net Framework (x64): V2.0.50727, V3.0, V3.5, V4.0.30319
    Other: Microsoft Access database engine 2010 (English) (x86)
     
    Note: The problem occurs with Microsoft Access database engine 2010 (English) (x64) too...

     

     Private Sub ReadFile()
     Dim FileName As String = "C:\blablabla.xlsx"
     Dim FirstSheetName As String
     Dim ConnectionString As String = String.Empty
     Dim Factory As DbProviderFactory = DbProviderFactories.GetFactory("System.Data.OleDb")
     Dim Connection As DbConnection = Factory.CreateConnection()
    
     Try
     ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & FileName & ";Extended Properties=""Excel 12.0;HDR=YES;IMEX=1;"""
     Connection.ConnectionString = ConnectionString
     Connection.Open()
     ...
     Catch ex As Exception
     Publish(ex)
     Finally
     If Not Connection Is Nothing Then
     Connection.Close()
     Connection.Dispose()
     End If
     End Try
     End Sub
    
    Thx a lot!!
    
    
    
    
    
    
    
    

    Complete Event Log 1

    Log Name:      Application

    Source:        Application Error

    Date:          12/2/2010 11:31:04 AM

    Event ID:      1000

    Task Category: (100)

    Level:         Error

    Keywords:      Classic

    User:          N/A

    Computer:      WHMM12391.portail.SRHP

    Description:

    Faulting application Batch.ProcessCtlx86.exe, version 1.0.0.0, time stamp 0x4cf68f85, faulting module msxml6.dll, version 6.20.5000.0, time stamp 0x49e037aa, exception code 0xc0000005, fault offset 0x0001f3c2, process id 0x5b98, application start time 0x01cb923294ac2435.

    Event Xml:

    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

      <System>

        <Provider Name="Application Error" />

        <EventID Qualifiers="0">1000</EventID>

        <Level>2</Level>

        <Task>100</Task>

        <Keywords>0x80000000000000</Keywords>

        <TimeCreated SystemTime="2010-12-02T16:31:04.000Z" />

        <EventRecordID>16880</EventRecordID>

        <Channel>Application</Channel>

        <Computer>WHMM12391.portail.SRHP</Computer>

        <Security />

      </System>

      <EventData>

        <Data>Batch.ProcessCtlx86.exe</Data>

        <Data>1.0.0.0</Data>

        <Data>4cf68f85</Data>

        <Data>msxml6.dll</Data>

        <Data>6.20.5000.0</Data>

        <Data>49e037aa</Data>

        <Data>c0000005</Data>

        <Data>0001f3c2</Data>

        <Data>5b98</Data>

        <Data>01cb923294ac2435</Data>

      </EventData>

    </Event>


     

     

     

    Complete Event Log 2

    Log Name:      Application

    Source:        Application Error

    Date:          12/2/2010 11:30:56 AM

    Event ID:      1000

    Task Category: (100)

    Level:         Error

    Keywords:      Classic

    User:          N/A

    Computer:      WHMM12391.portail.SRHP

    Description:

    Faulting application Batch.ProcessCtlx86.exe, version 1.0.0.0, time stamp 0x4cf68f85, faulting module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, fault offset 0x00000000, process id 0x5b98, application start time 0x01cb923294ac2435.

    Event Xml:

    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

      <System>

        <Provider Name="Application Error" />

        <EventID Qualifiers="0">1000</EventID>

        <Level>2</Level>

        <Task>100</Task>

        <Keywords>0x80000000000000</Keywords>

        <TimeCreated SystemTime="2010-12-02T16:30:56.000Z" />

        <EventRecordID>16879</EventRecordID>

        <Channel>Application</Channel>

        <Computer>WHMM12391.portail.SRHP</Computer>

        <Security />

      </System>

      <EventData>

        <Data>Batch.ProcessCtlx86.exe</Data>

        <Data>1.0.0.0</Data>

        <Data>4cf68f85</Data>

        <Data>unknown</Data>

        <Data>0.0.0.0</Data>

        <Data>00000000</Data>

        <Data>c0000005</Data>

        <Data>00000000</Data>

        <Data>5b98</Data>

        <Data>01cb923294ac2435</Data>

      </EventData>

    </Event>

     

    • Moved by Bessie Zhao Wednesday, December 8, 2010 2:13 AM for better support (From:Excel for Developers)
    Monday, December 6, 2010 5:41 PM

Answers

  •  

    Hello BenderSI,

     

    The Access Database Engine is not supported for use from a Windows Service. The download page lists the intended and non-intended uses for these components.

     

    Excerpt:

    "The Access Database Engine 2010 Redistributable is not intended:

    ...

    4.To be used within a service program or web application that relies on a Windows service."

     

    Microsoft Access Database Engine 2010 Redistributable

    http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d

     

    If you are trying to read/write to an Excel xlsx file, we would recommend using Open XML. KB 257757 will point you to some articles on OOXML.

     

    KB 257757 Considerations for server-side Automation of Office

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757

     

    The only items I can suggest for your current configuration are:

    1. Try running the Windows Service under an interactive user account

    2. Ensure the interactive user account has permissions to the Excel file

    3. Update your connection string so that the extended properties use Excel 12.0 Xml instead of just Excel 12.0

     

    Regards,

     

    Kirk Beller

    Microsoft Online Community Support


    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, December 8, 2010 4:20 PM

All replies

  • Hello BenderSI,

    Thanks for posting. Since this issue is more an ADO.NET issue, to get more support, I will move this issue from Excel for developer forum to ADO.NET Managed Providers forum. Have a nice day.

    Best regards,
    Bessie Zhao - MSFT
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, December 8, 2010 2:20 AM
  • What is the size of the file? It could generate OutOfMemory exception or application process can be recycled if it is ASP.NET application


    Val Mazur (MVP)

    http://www.xporttools.net

    Wednesday, December 8, 2010 2:45 AM
    Moderator
  • What is the size of the file? It could generate OutOfMemory exception or application process can be recycled if it is ASP.NET application

     


    Val Mazur (MVP)

     

    http://www.xporttools.net


    Thx for the answer. My application is a windows service. The size of xlsx files is between 11kb and 500kb. 99% of time...
    Wednesday, December 8, 2010 3:42 PM
  •  

    Hello BenderSI,

     

    The Access Database Engine is not supported for use from a Windows Service. The download page lists the intended and non-intended uses for these components.

     

    Excerpt:

    "The Access Database Engine 2010 Redistributable is not intended:

    ...

    4.To be used within a service program or web application that relies on a Windows service."

     

    Microsoft Access Database Engine 2010 Redistributable

    http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d

     

    If you are trying to read/write to an Excel xlsx file, we would recommend using Open XML. KB 257757 will point you to some articles on OOXML.

     

    KB 257757 Considerations for server-side Automation of Office

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757

     

    The only items I can suggest for your current configuration are:

    1. Try running the Windows Service under an interactive user account

    2. Ensure the interactive user account has permissions to the Excel file

    3. Update your connection string so that the extended properties use Excel 12.0 Xml instead of just Excel 12.0

     

    Regards,

     

    Kirk Beller

    Microsoft Online Community Support


    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, December 8, 2010 4:20 PM
  • Thx a lot Kirk. We will try your suggestions and I'll come back with a feedback about this!!!!
    Wednesday, December 8, 2010 4:39 PM