locked
3275 - Unexpected error from external database driver when exporting to excel RRS feed

  • Question

  • I have an application I wrote in VB6 that export data from Access to Excel by a query and that procedure has worked fine for years. Now, MS has done a recent update (10/10/2017) that breaks down that functionality. A customer of mine has restored his system to an old restore point created prior 10/10 and all goes well again. Does somebody knows a solution for this bug?

    The query I use has this format: SELECT field1, field2, field3 INTO [EXCEL 8.0;DATABASE=C:\MyFolder\Workbook.xls;].[MyWorkSheetName] From TableName


    Codelines



    • Edited by Codelines Saturday, October 14, 2017 11:47 AM
    Saturday, October 14, 2017 11:43 AM

Answers

  • The problem with Codelines workaround is that it requires the client to have Excel installed. Many users have no alternative but to uninstall and hide the Microsoft update that brought about the issue. (for Windows 10: KB4041676 or KB4041691 and for Windows 7: KB4041681.)

    Brian


    • Edited by McBrian Tuesday, October 17, 2017 4:35 PM
    • Proposed as answer by tonywush Thursday, October 19, 2017 2:07 AM
    • Marked as answer by Codelines Thursday, October 19, 2017 8:02 AM
    Tuesday, October 17, 2017 4:34 PM
  • Hi Codelines,

    I can see that update cause this issue.

    but you did not mentioned which version of Access you are using and which exact update you installed.

    it can help us to find the issue in specific update.

    also I want to inform you that the query you provided is not able to reproduce the issue on our side.

    I suggest you to post the whole code.

    we will try to make a test with that specific version of Access that you are using.

    we will try to provide you solution if available.

    if no any solution available for the issue then we can try to submit the feedback to Access User Voice.

    so Access developers can come to know about the issue and try to fix it in next update.

    so try to provide above mentioned details , we will try to provide you further support.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Codelines Monday, October 16, 2017 11:51 AM
    Monday, October 16, 2017 2:05 AM

All replies

  • Hi Codelines,

    I can see that update cause this issue.

    but you did not mentioned which version of Access you are using and which exact update you installed.

    it can help us to find the issue in specific update.

    also I want to inform you that the query you provided is not able to reproduce the issue on our side.

    I suggest you to post the whole code.

    we will try to make a test with that specific version of Access that you are using.

    we will try to provide you solution if available.

    if no any solution available for the issue then we can try to submit the feedback to Access User Voice.

    so Access developers can come to know about the issue and try to fix it in next update.

    so try to provide above mentioned details , we will try to provide you further support.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Codelines Monday, October 16, 2017 11:51 AM
    Monday, October 16, 2017 2:05 AM
  • Hi, Deepak.

    The problem started after 10/10 in machines with Office 2010. I don't know witch of the updates caused the problem as there are three updates in october. The query above works in my machine with Office 2007 even after I have done the last updates in 10/10.

    Thanks.


    Codelines


    • Edited by Codelines Monday, October 16, 2017 11:54 AM
    Monday, October 16, 2017 11:51 AM
  • Hi Codelines,

    I try to make a test with Access 2010 and Access 2016.

    I find that with Access 2016 the query is working fine and export the data to Excel successfully.

    but when I try to make a test with Access 2010.

    I get error below.

    I am using version of Access 2010 below to make a test.

    I suggest you to temporary move to last working version and wait till the new update release.

    for a work around , if you need VBA code then let me know about it.

    I will try to provide you a code which can export the data to Excel with the latest version in Access 2010.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 17, 2017 1:36 AM
  • Hi, Deepak!

    I think the error was raised cause you need a period between the "Sheet1" and the previous expression. 

    I'm using Microsoft DAO 3.6 object library and my customers don't need to have Access installed for that query to work. They need only to have the components used by the library that the setup program installs. Perhaps one of the components used by Microsoft DAO 3.6 object library has been modified by the update. Below I list the components I distribute:

    ASYCFILT.DLL, DAO360.DLL, expsrv.dll, ITIRCL.DLL, ITSS.DLL, msjet40.dll, 
    msjint40.dll, msjter40.dll, msjtes40.dll, msrd2x40.dll, msrd3x40.dll, msrepl40.dll, 
    mswdat10.dll, MSWSTR10.DLL, vbajet32.dll.

    Thanks.


    Codelines


    • Edited by Codelines Tuesday, October 17, 2017 2:17 AM
    Tuesday, October 17, 2017 2:09 AM
  • Hi Codelines,

    you had mentioned that,"you need a period between the "Sheet1" and the previous expression."

    I already try that and got the same error.

    in Access 2016 , it is working exactly this way.

    in your second last reply, you had mentioned that issue is with Access 2010 but now you had mentioned that customer don't need to install Access on his side.

    so can you please clear this and provide the exact steps and code to reproduce the issue.

    so that we can try to reproduce the issue like exactly you are doing at your side.

    so that we can avoid the difference in a way of reproducing the issue.

    Thanks for your understanding.

    Regards

    Deepak 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 17, 2017 2:36 AM
  • Hi, Deepak.

    I have a lot of queries with complex inner joins and they require multiple tables. They have worked for more than 15 years but now no one works anymore. The format is the format like that you are using with the period. A simple sample is that below:

    SQLExport = "SELECT DISTINCT  L.Realizado, L.DataReferencia, L.Data As DataRealizacao, C.Codigo As CodConta, C.DesConta As Conta, L.Documento, L.Historico, L.Valor, L.SaldoConta, L.SaldoGlobal, L.DataId INTO [EXCEL 8.0;DATABASE=C:\CashPreview\Pendencias.xls;].[Pendencias] FROM Lancamentos As L INNER JOIN Contas As C ON L.CodConta=C.Codigo"

    I've mentioned Access 2010 to inform you the update that could caused the problem as in my machine with Access 2007 and others without Access the problem doesn't occur. My customers that have complained about the problem use Office 2010.

    I decided tho use the Excel object model to export data and abandoned that technique.


    Codelines


    • Edited by Codelines Tuesday, October 17, 2017 3:26 AM
    Tuesday, October 17, 2017 3:22 AM
  • Hi Codelines,

    thank you for informing us about the work around you are using to avoid the issue caused due to update.

    it will help other community members in future.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 17, 2017 6:00 AM
  • The problem with Codelines workaround is that it requires the client to have Excel installed. Many users have no alternative but to uninstall and hide the Microsoft update that brought about the issue. (for Windows 10: KB4041676 or KB4041691 and for Windows 7: KB4041681.)

    Brian


    • Edited by McBrian Tuesday, October 17, 2017 4:35 PM
    • Proposed as answer by tonywush Thursday, October 19, 2017 2:07 AM
    • Marked as answer by Codelines Thursday, October 19, 2017 8:02 AM
    Tuesday, October 17, 2017 4:34 PM
  • Yes, Brian, that was the reason I chose that good old technique for exporting data to Excel.

    Codelines

    Tuesday, October 17, 2017 9:22 PM
  • Awesome, this solution works!

    Too bad that MS is breaking lots of things nowadays along with these monthly CU patches. No wonder they call Win 10 as "Bug 10"

    • Proposed as answer by PilotPat Saturday, December 30, 2017 1:42 AM
    • Unproposed as answer by PilotPat Saturday, December 30, 2017 1:42 AM
    Thursday, October 19, 2017 2:14 AM
  • You can simply change the call from [EXCEL 8.0 ... into [EXCEL 12.0

    and it will work again.

    But then, on installations prior Office 2010, it will crash.  So, you need to find out what version of EXCEL is installed on the customers PC.  Here is (possibly) a solution for that :

    Public Sub GetExcelVersion()
    
    Dim ExcelVersion as string
    Dim ExcelObj as Object
    
    On Local Error Resume Next
    
        Set ExcelObj = CreateObject("Excel.Application")
    
        If Err = 0 Then
            'get version number
            ExcelVersion = Left(ExcelObj.Version, InStr(1, ExcelObj.Version, ".") + 1)
            'feedback to user
            MsgBox "Excel " & ExcelVersion & " installed.", vbInformation, "Excel"   
    
    Else
            'excel is not installed
            ExcelVersion = "0.0"
            'feedback to user
            MsgBox "Excel is not installed on this computer", vbExclamation, "Excel"
        End If
    
        Set ExcelObj = Nothing
    
    On Local Error GoTo 0
    
    
    End Sub
    
                


    When the ExcelVersion value is below 16.0 then use [EXCEL 8.0   else use [EXCEL 12.0 for your export query

    • Proposed as answer by PilotPat Saturday, December 30, 2017 1:46 AM
    • Edited by PilotPat Saturday, December 30, 2017 2:49 AM
    Saturday, December 30, 2017 1:46 AM