32-bit Text drivers (Microsoft Access , Microsoft Excel and Text files ) from a 64 bit application on windows 7

后端 未结 5 429
梦谈多话
梦谈多话 2020-12-06 08:16

Hi i have an application developed on XP with Text ODBC drivers. But when i deployed on Win 7 with office 2007, i have connection issues.



        
相关标签:
5条回答
  • 2020-12-06 08:53

    I'm pretty sure it'll work automatically (even on a 64-bit machine) as long as the executing process is 32-bit.

    Try recompiling to target x86 specifically.

    0 讨论(0)
  • 2020-12-06 08:59

    You need the 64-bit Microsoft Access Database Engine 2010 Redistributable

    http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en

    Then try

    Microsoft Access Text Driver (*.txt, *.csv)
    

    for the driver name.

    AFAIK, all 64-bit ODBC drivers from the Microsoft Access Database Engine 2010 64-bit Redistributable have slightly changed their driver names, I guess to differentiate them from their 32-bit counterparts.

    0 讨论(0)
  • 2020-12-06 09:12

    A lot of people seem desperate here, I want to offer a few solutions. But, first I want to highlight what a dated proprietary trash idea from the 90s this is.

    1. Use Unix ODBC to host the text file from Linux which the docs (seem to) claim to support an implementation of the Microsoft text driver

    2. A better option would be of course to import the CSV into PostgreSQL.

      1. I would suggest just doing this with \COPY and dropping the notion of a CSV.
      2. You can maintain the CSV with PostgreSQL acting as a server with the Foreign Data Wrapper (file_fdw).
    3. If you don't want to run an RDBMS, the modern way would be to use SQLite. This is a great idea if you don't need the server/client model.

    The ODBC->text interface is especially insane, because ODBC doesn't define configuration beyond connection (so I assume there are lots of assumptions there).

    0 讨论(0)
  • 2020-12-06 09:15

    I had this exact problem and the recompiling to target x86 specifically worked! Note that in order to do this I had to specify the Target CPU in the advanced compiler setting dialog - Project Menu> Properties> Compile tab> Advanced Compile Options button.

    Before finding this forum entry I did install the Microsoft Access Database Engine 2010 Redistributable (32-bit) but I don't know if that had any affect on this issue.

    As mentioned above, when the executing process is 32-bit (in this case compiling against x86 makes the app 32-bit specific) the application will use the drivers from C:\Windows\SysWOW64\odbcad32.exe.

    Thanks Cameron.

    0 讨论(0)
  • 2020-12-06 09:17

    We were doing this from ASP.Net and got it working on Windows 2012 just by moving the one site into a separate app pool that had "32-bit Enabled" turned on in the advanced settings for the App Pool.

    0 讨论(0)
提交回复
热议问题