ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Retrieving Pipe (|) delimited text file into ADO Recordset (https://www.excelbanter.com/excel-programming/405568-retrieving-pipe-%7C-delimited-text-file-into-ado-recordset.html)

Mark

Retrieving Pipe (|) delimited text file into ADO Recordset
 
Hello.

I'd like to retrieve a pipe (|) delimited text file into an ADO recordset.

I've attempted to follow the intrsuctions listed he

http://msdn2.microsoft.com/en-us/library/ms974559.aspx

and have it working, aside form the fact that the record is not being parsed
into fields.

According to that Microsoft article (at least as I read it, perhaps
incorrectly), all I needed to do was use:

FMT = Delimited(|)

in the connection string... like this:


stConString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited(|)""


With that, I'm getting the proper data in my ADO recordset (which I in turn
intend to use as a PivotCache, but I know how to do that), but it's not
delimited...

It's just one big a|b|c|d|e single field record.

Can someone help me with that?

Thanks.

Mark

over that hurdle...
 
I'd like to retrieve a pipe (|) delimited text file into an ADO recordset.

over that hurdle... thanks.

I hadn't wanted to muck with the Registry setting, but, since the other
method wasn't working, I looked into the same article's discussion of doing
that, and have it working...

both setting the key to Delimited(|), and setting it back to CSVDelimited



Mark

still having a little bit of trouble...
 
still having a little bit of trouble...

I have it doing the input of the pipe delimited file, but only as long as
there are headers in the text file.

I read through the article's content about schema.ini files, and have put
one in for my file.

The coding reads the header,s but still puts all of the data into the first
field.

I can work around putting a header in my file, but I must still not quite be
there with what's intended.


All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com