E
Erwin Kalvelagen
Hi:
I am struggling a bit with transfertext. I have a small tool that should
import relative large amounts of data into Access. I currently use
the following algorithm:
1. write a csv file
format:
i1,i1,-6.56505736000000E+0001
i1,i2, 6.86533416000000E+0001
i1,i3, 1.00750712000000E+0001
....
if a string contains a blank I quote it as:
"a a","b b", 1.00750712000000E+0001
(strings are to up to 31 chars, last field is double
precision).
2. Read the file using:
AccessApplication.DoCmd.TransferText(acImportDelim,'',table,fln,false);
3. Rename fields to something more meaningful.
This works like a charm here in the US. However, I get into
troubles when the tool is used in other countries. I have
heard in Germany a table with one field is created.
When I change my language setting to German I get different
results: I get a table with three fields but the floating
point number is not read correctly. A user in Belgium said
it worked correctly on one machine but incorrectly on
another machine, and playing with language settings did
not help.
So here are my questions:
1. Should I write a CSV file using the windows locale
settings for decimal point etc? What should be the
field separator and the double quote? I am worried
about different behavior in Access even with the same
Windows locale -- can it be that Access uses a default
file format specification that may differ from the
global Windows settings? Can I interrogate that default
import format specification?
2. Or should I use an import specification? How do
I do that: just write a schema.ini in the directory
of the csv file? I am worried about:
http://support.microsoft.com/default.aspx?scid=kb;en-us;241477
3. Are there any better fast methods to get large data from memory
into Access?
Thanks, Erwin
I am struggling a bit with transfertext. I have a small tool that should
import relative large amounts of data into Access. I currently use
the following algorithm:
1. write a csv file
format:
i1,i1,-6.56505736000000E+0001
i1,i2, 6.86533416000000E+0001
i1,i3, 1.00750712000000E+0001
....
if a string contains a blank I quote it as:
"a a","b b", 1.00750712000000E+0001
(strings are to up to 31 chars, last field is double
precision).
2. Read the file using:
AccessApplication.DoCmd.TransferText(acImportDelim,'',table,fln,false);
3. Rename fields to something more meaningful.
This works like a charm here in the US. However, I get into
troubles when the tool is used in other countries. I have
heard in Germany a table with one field is created.
When I change my language setting to German I get different
results: I get a table with three fields but the floating
point number is not read correctly. A user in Belgium said
it worked correctly on one machine but incorrectly on
another machine, and playing with language settings did
not help.
So here are my questions:
1. Should I write a CSV file using the windows locale
settings for decimal point etc? What should be the
field separator and the double quote? I am worried
about different behavior in Access even with the same
Windows locale -- can it be that Access uses a default
file format specification that may differ from the
global Windows settings? Can I interrogate that default
import format specification?
2. Or should I use an import specification? How do
I do that: just write a schema.ini in the directory
of the csv file? I am worried about:
http://support.microsoft.com/default.aspx?scid=kb;en-us;241477
3. Are there any better fast methods to get large data from memory
into Access?
Thanks, Erwin