Code: Select all
Private Sub Command1_Click()
With New ADODB.Stream
.Type = adTypeText
.Charset = "utf-8"
.Open
.LoadFromFile "C:\Lavori_Vb6\LEGGI_CSV_COMUNI\FILES\COMUNI_CF_SIC.csv" '(substitute the location and name of your .csv file)
Debug.Print .ReadText(adReadAll)
.Close
End With
End Sub
.ReadText(adReadAll)
============================
for test i have used this code but googling suggest to use adostream
Code: Select all
Sub ReadTextFile()
Dim strLine As String
Dim FSO As Object
Dim TSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TSO = FSO.OpenTextFile("C:\Lavori_Vb6\LEGGI_CSV_COMUNI\FILES\COMUNI_CF_SIC.csv")
Do While Not TSO.AtEndOfStream
strLine = TSO.ReadLine
Debug.Print strLine
Loop
TSO.Close
Set TSO = Nothing
Set FSO = Nothing
End Sub
001001,A074,Agliè
instead:
001001,A074,Agliè