I found the answer to my problem, adding IMEX=1 to the connection string
tells the query to interprete all the data as text. And then I convert
string to number with strtofloat();
The connection string then looks like this:
adoquery1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=g:\temp+';Extended Properties=''text;FMT=Delimited; IMEX=1''';
To answer Del, all the files have numbers with comma;
To answer Chris, schema.ini file is needed if the text file is TAB
delimited, and when delimiter is comma, or some other symbol (like ;) it is
not needed.
===
Thanks for the IMEX information - I am glad you have solved the problem.
IFAICT this does not seem to be documented by MS with respect to text
import (however, http://support.microsoft.com/kb/194124/EN-US/ describes
IMEX for import from Excel).
note : Setting IMEX=1 tells the driver to use Import mode. In this state, the registry setting ImportMixedTypes=Text will be noticed. This forces mixed data to be converted to text. For this to work reliably, you may also have to modify the registry setting, TypeGuessRows=8. The ISAM driver by default looks at the first eight rows and from that sampling determines the datatype. If this eight row sampling is all numeric, then setting IMEX=1 will not convert the default datatype to Text; it will remain numeric.
You must be careful that IMEX=1 not be used indiscriminately. This is IMPORT mode, so the results may be unpredictable if you try to do appends or updates of data in this mode.