none
Microsoft Access Text Driver does not want to work RRS feed

  • Question

  • Hi all, following error has been keeping me busy for the last days and no solution so far in sight. Please help.

    I am working on Windows 10 Home 64bit PC and am using Microsoft Office 365. In Excel I need to create a little solution, where I retrieve data from a csv-File. I have downloaded AccessDatabaseEngine_X64 and successfully installed. The Driver is visible in the ODBC-Administrator-Panel, in the tabs User-DSN, System-DSN and Driver.

    I want do use ADODB for this purpose. My relevant Code Snippet:

        Dim adoConnection As ADODB.Connection

        strPath = "D:\myPathToFile\myFile.csv"
        Set adoConnection = New ADODB.Connection

        strConnection = _
            "Driver={Microsoft Access Text Driver (*.txt, *.csv)}; DBQ=" & strPath

        adoConnection.open strConnection


    Unfortunately it stops here with following error message:

    "[Microsoft][ODBC Text Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x30fc Thread 0x3100 DBC 0x5c0349a8    Text"

    I have been googling for the last three days, but could not find a clear and helpful answer. Some were saying, that the registry needs permission. The weird thing though is, that the other drivers "Microsoft Excel Driver" as well as "Microsoft Access Driver" both work perfectly fine. Would I not have permission issues here?

    If anyone has encountered similar issue and knows how to solve it, would be fantastic.

    Thanks a lot.

    Thursday, January 18, 2018 7:05 PM

Answers

  • Hello mazarata,

    For text/csv file, the data source is the file's folder rather than file itself. If you want to get data from the file, please try to refer to below code.

     Dim adoConnection As ADODB.Connection
     Dim RST As Recordset
        strPath = "D:\myPathToFile"
        Set adoConnection = New ADODB.Connection
    
        strConnection = _
            "Driver={Microsoft Access Text Driver (*.txt, *.csv)}; DBQ=" & strPath
    
        adoConnection.Open strConnection
        Set RST = New Recordset
        RST.Open "Select * from myFile.csv", adoConnection

    Best Regards,

    Terry


    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 mazarata Thursday, January 25, 2018 12:58 PM
    Thursday, January 25, 2018 9:40 AM

All replies

  • Hi,

    I notice that you are using some codes for data connection in Excel. This forum focuses on general discussion for Office 2016. 

    To better resolve the issue, I would move the thread to Excel for developers forum for more help. Thanks for your understanding.


    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, January 19, 2018 8:41 AM
  • Thank you Winnie for moving it.
    Friday, January 19, 2018 9:16 AM
  • Hello mazarata,

    I need confirm with you some information so we could try to reproduce your issue.

    What is the Office version in you PC? Office 2016, 2013 or others?

    What's the version of AccessDatabaseEngine_X64? Is it Microsoft Access Database Engine 2010 or Microsoft Access Database Engine 2016 or others?

    Best Regards,

    Terry


    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, January 23, 2018 8:19 AM
  • Dear Terry

    I am using Office365, so I presume it must be 2016.

    The AccessDatabaseEngine_X64 is Version 2016, downloaded from here:

    https://www.microsoft.com/en-us/download/details.aspx?id=54920

    Thank you

    Wednesday, January 24, 2018 8:40 AM
  • Hello mazarata,

    For text/csv file, the data source is the file's folder rather than file itself. If you want to get data from the file, please try to refer to below code.

     Dim adoConnection As ADODB.Connection
     Dim RST As Recordset
        strPath = "D:\myPathToFile"
        Set adoConnection = New ADODB.Connection
    
        strConnection = _
            "Driver={Microsoft Access Text Driver (*.txt, *.csv)}; DBQ=" & strPath
    
        adoConnection.Open strConnection
        Set RST = New Recordset
        RST.Open "Select * from myFile.csv", adoConnection

    Best Regards,

    Terry


    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 mazarata Thursday, January 25, 2018 12:58 PM
    Thursday, January 25, 2018 9:40 AM
  • Dear Terry great, it perfectly works now.

    Thanks very much for your help.

    Cheers, mazarata

    Thursday, January 25, 2018 12:58 PM