In the Registry at
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text
the default key for Text Format is:
"Format" = "CSVDelimited"
I can use the following OleDB connection string with an OleDB dataAdapter to
read a comma delimited text file when "Format" = "CSVDelimited"
conOle.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\1A\;Extended Properties=""Text;HDR=yes;FMT=Delimited"""
But if the text file is tab delimited - my connection string reads the
entire row into one field per row (no column delimiting). If I change the
Registry setting to
"Format" = "TabDelimited"
then I can read the tab delimited text file with an OleDB dataAdapter
correctly. But I also want to be able to read a pipe | delimited text file
using an OleDB dataAdapter. I tried setting "Format" = "Delimited" but got
an error message in my app that said the Registry had an invalid key. I
tried "," for the comma delimited file instead of CSVDelimited , but got the
same "Invalid Registry Key..." error.
I was following the documentation at
http://msdn.microsoft.com/en-us/library/bb177651.aspx
for initializing the Text Data source driver which includes "Delimited" as
one of the keys that can be used. But that did not work.
Is there a generic setting I can place in the Registry so that I can use the
Delimeter of my choice? Or is there a way to override the Registry setting
from my application? If there is not - then is there a way (some key) I
could use a semicolon ; or pipe | as a delimiter for the OleDB DataAdapter?
Any information appreciated.
Thanks,
Rich