>>> use code - tags <<<
Iin effect instead to Debug.Print RS.Fields("REG").Value=1 i have Debug.Print RS.Fields(0).Value="REG"
attached the .csv file and schema.ini
Code:
Option Explicit
Sub Main()
Dim CON As ADODB.Connection
Dim RS As ADODB.Recordset
Dim SQL As String
Dim thePath As String
'C:\TABULATI\TEST_ISTAT.CSV
Set CON = New ADODB.Connection
Set RS = New ADODB.Recordset
thePath = "C:\TABULATI\"
CON.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & thePath & ";" _
& "Extended Properties=""text;HDR=no;"""
CON.Open
SQL = "SELECT * FROM TEST_ISTAT.CSV"
RS.CursorLocation = adUseClient
RS.Open SQL, CON, adOpenForwardOnly, adLockReadOnly
Do While Not RS.EOF
Debug.Print RS.Fields(0).Value
RS.MoveNext
Loop
RS.Close
Set RS = Nothing
CON.Close
Set CON = Nothing
End Sub
attached the .csv file and schema.ini
Attachments
Last edited by a moderator: