ADODB Recordset is skipping the first line.
Posted on 2006-11-02
I am using ADO to read a comma-delimited file. This is working fine except that it is skipping the first line in the file. I have already set the connection string to no header row. Sample code is below.
set conn = CreateObject("ADODB.Connection")
set rs = CreateObject("ADODB.Recordset")
connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & s.GetEnvironmentString("Directory", True) & _
"\;Extended Properties=" & Chr(34) & "text;HDR=NO;FMT=Delimited" & Chr(34)
rs.Open "SELECT * FROM " & fileDirectory & fileB, conn, adOpenStatic, adLockOptimistic, adCmdText
Do While Not rs.eof
The RecordCount returned is actually correct for the file but it starts with the second line in the file and the last record is null filled. Any help with this is much appreciated.