Windows 7 上的 Microsoft Access 文本 ODBC 驱动程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1953416/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:37:56  来源:igfitidea点击:

Microsoft Access Text ODBC Driver on Windows 7

windowsdelphiodbc

提问by M Schenkel

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)

我创建了一个 Delphi 应用程序,它利用 ODBC 数据源访问 csv 格式的文本文件。驱动程序是“Microsoft Access Text Driver”。但是当我在 Windows 7 计算机上部署我的应用程序时它不起作用,因为这个驱动程序不可用(odbcad32 中只有两个可用:sql native client 和 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.

如何安装此驱动程序?我试图安装 MDAC,但它没有做任何事情。没有错误或任何错误,但它只显示一个快速滚动条,仅此而已。而且我听说 MDAC 在 Windows 7 上已被 WDAC 取代。

EDIT: I should add this is Windows 7 Home, not Professional.

编辑:我应该补充说这是Windows 7 Home,而不是Professional。

采纳答案by skamradt

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.

您可能必须安装 Microsoft Jet 驱动程序。我相信微软不久前将它从 MDAC 中分离出来,并且不再默认安装。

EDITAfter 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.

编辑经过进一步研究,他们似乎已经完全从喷气发动机中删除了文本文件驱动程序。您仍然可以使用 Microsoft ODBC DB Provider for ODBC Drivers 来访问 dBase 和 Excel 文件,但不再是文本文件。

回答by Mark Plumpton

You have to run the ODBC Administrator from this location:

您必须从该位置运行 ODBC 管理器:

C:\Windows\SysWOW64\odbcad32.exe

C:\Windows\SysWOW64\odbcad32.exe

then you will see all the x32 drivers

然后你会看到所有的 x32 驱动程序

回答by Jeroen Wiert Pluimers

Project JEDI has an open source TJvCSVDataSet

JEDI 项目有一个开源的TJvCSVDataSet

回答by Dirk

I found I could access the Microsoft text Driver if my application is compiled targeting x86 cpus.

我发现如果我的应用程序是针对 x86 cpu 编译的,我可以访问 Microsoft 文本驱动程序。

回答by fupsduck

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?

为什么不减轻它的负担并使用带有 TStringList.LoadFromFile() 的 VCL TStringList 而忘记 ODBC、MDAC、WDAC 和其他任何加重手头任务的事情?

回答by Pavel Minaev

I believe you'll need to install this packageto get the text driver (among others).

我相信你需要安装这个包来获取文本驱动程序(等等)。

回答by Warren P

Here's a CSV demothat 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.

这是一个 CSV 演示,不需要您安装任何组件或编写任何解析代码。如果您可以调用我的类 .Create 方法,则无需安装任何东西即可使用此代码。

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.

它使用两个实现 JvCsvDataSet 组件的单元文件,它仍然是一个类,可以像创建 TStringList 一样实例化它,只需创建一个 TJvCsvDatSet。