Help! I'm trying to help out another post in this newsgroup.

I don't understand why the following does not display each field in the
header row.

Only "Customer" is displayed along with all of the data columns.

Watch for word-wrap.

<< test.csv >>
Material, Customer, month
10000,19ABC, 122004

<< test.vbs >>

Option Explicit
'*
Const cVBS = "test.vbs"
Const cCSV = "test.csv"
Const cDIR = "C:\Temp\"
Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=?;Extended
Properties=""text;HDR=NO;FMT=Delimited"""
'*
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
'*
Dim intRST
intRST = 0
Dim strRST
'*
Dim objADO
Set objADO = CreateObject("ADODB.Connection")
objADO.Open Replace(cDSN,"?",cDIR)
Dim objRST
Set objRST = CreateObject("ADODB.Recordset")
objRST.Open "SELECT * FROM " & cCSV, objADO, adOpenStatic,
adLockOptimistic, adCmdText
'*
Do Until objRST.EOF
WScript.Echo "#" & objRST.Fields.Count
For Each strRST in objRST.Fields
WScript.Echo "*" & strRST
Next
objRST.MoveNext
Loop
'*
Set objRST = Nothing
Set objADO = Nothing


However, it will work if I change the CSV to:

<< test.csv >>
0,1,2
10000,19ABC, 122004


The above is based on:

Much ADO About Text Files
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/ht
ml/scripting03092004.asp

Thanks in advance.