问题
I created a Delphi application which utilizes an ODBC data source to access text files in csv format. The driver is the "Microsoft Access Text Driver". But when I deploy my application on a Windows 7 computer it does not work because this driver is not available (there are only two available in odbcad32: sql native client and sql server)
How can I install this driver? I have tried to install MDAC, but it doesn't do anything. No errors or anythinig, but it just shows a quick scroll bar and that is it. And I have heard that MDAC has been replaced by WDAC on Windows 7.
EDIT: I should add this is Windows 7 Home, not Professional.
回答1:
You might have to install the Microsoft Jet driver. I believe that Microsoft broke it out of MDAC awhile back, and it is no longer be installed by default.
EDIT After further research it appears that they have removed the text file drivers from the jet engine entirely. You can still use the Microsoft ODBC DB Provider for ODBC Drivers to access dBase and Excel files, but no longer text files.
回答2:
You have to run the ODBC Administrator from this location:
C:\Windows\SysWOW64\odbcad32.exe
then you will see all the x32 drivers
回答3:
Project JEDI has an open source TJvCSVDataSet
回答4:
Why not lighten it up and use a VCL TStringList with TStringList.LoadFromFile() and forget about ODBC, MDAC, WDAC and whatever else weighs down the task at hand?
回答5:
I found I could access the Microsoft text Driver if my application is compiled targeting x86 cpus.
回答6:
I believe you'll need to install this package to get the text driver (among others).
回答7:
Here's a CSV demo that doesn't require you to install any components or write any parsing code. If you can call my class .Create method, you can use this code without installing anything.
It uses two unit files that implement the JvCsvDataSet component, which is still a class, which can be instantiated the same way you can create a TStringList, you just create a TJvCsvDatSet.
来源:https://stackoverflow.com/questions/1953416/microsoft-access-text-odbc-driver-on-windows-7