This code populates a listbox from a .CSV
This code populates a listbox from a .CSV
Rate This code populates a listbox from a .CSV
(1(1 Vote))
Dim loconnection As New ADODB.Connection
Dim lorecordset As New ADODB.Recordset
loconnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""TEXT;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;"""
lorecordset.Open "select * from xxx.csv", _
loconnection, adOpenStatic, adLockReadOnly, adCmdText
Do While Not lorecordset.EOF
List1.AddItem lorecordset.Fields(1).Value
List2.AddItem lorecordset.Fields(2).Value
lorecordset.MoveNext
Loop
loconnection.Close
End Sub
This code populates a listbox from a .CSV Comments
No comments yet — be the first to post one!
Post a Comment