views:

3046

answers:

8

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  A: 

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?

fupsduck
In the end that may be what I end up doing. The nice thing about using the text driver was the csv file had headers. So I could access fields by their name. This a data conversion I need to do. It runs fine on my development machine. But now I need to run it on target computer. It's already coded; my hope was this was something simply so I am not forced to rewrite and parse.
M Schenkel
If your target DB table matches the CSV file a simple INSERT INTO table VALUES (TStringList.CommaText) will work and if not use TStringList.Insert, Delete, Move first to make it match.
fupsduck
I suspect the benefit he gets from using ODBC driver is that it is guaranteed to correctly handle whichever particular flavor of CSV (as there are a dozen, all slightly incompatible) he's dealing with.
Pavel Minaev
FWIW, JvCsvDataSet handles at least six or seven different CSV encoding variants (relating to quotation and escaping quote marks, backslash handling, and even handles both ANSI/ASCII and UTF8).
Warren P
+1  A: 

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.

skamradt
Did some searches on MS and could find nothing resembling the Jet driver download.
M Schenkel
Ok. So it sounds like a situation where there is no backwards compatibility. Thanks for your efforts.
M Schenkel
If anyone hits this page, the download, now, at http://www.microsoft.com/downloads/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d ("Microsoft Access Database Engine 2010 Redistributable") installs the "Microsoft Access Text Driver" for XPSP3 -> W7. And the last "Jet" downloads are at http://support.microsoft.com/default.aspx?kbid=239114#2
Sertac Akyuz
A: 

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

Pavel Minaev
Tried this. And it installed successfully; but did not provide the drivers in ODBC. I should add this is a "Windows 7 Premium Home" operating system.
M Schenkel
+3  A: 

Project JEDI has an open source TJvCSVDataSet

Jeroen Pluimers
Thanks for making this comment. But I figure rather than install a new component just for this task I would probably just read it as a stringlist and parse it.
M Schenkel
I wrote JvCsvDataSet. You put it on your form or data module. You make it active. You're done. You'd rather write parser code than run an installer?
Warren P
@Warren: I'd seen JvCSVDataSet, but never used it. I just tested it, and it is indeed that simple to use. Well done, and thanks!
Ken White
A: 

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.

Warren P
A: 

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

Dirk
It wasn't about accessing the Text Driver, but actually having the Text driver available.
M Schenkel
A: 

You have to run the ODBC Administrator from this location:

C:\Windows\SysWOW64\odbcad32.exe

then you will see all the x32 drivers

Mark Plumpton
A: 

C:\Windows\SysWOW64\odbcad32.exe did it for me, thanks!!

Andres