Help i need to import excel to my listview using adodb or oledb
but i dont know how? in vb6 i use adodb and the code is like here
Dim lngI as Long
Dim lvItem as listItem
*'adodb connection goes here...*
*'then this code will import all excel data in listview*
If Not (rs.EOF And rs.BOF) Then
For lngI = 0 To rs.Fields.Count - 1
*'this will set the first row of excel data as columnheader of the listview*
Listview1.ColumnHeaders.Add , , rs.Fields(lngI).Name
Next lngI
Do Until rs.EOF
If Not IsNull(rs.Fields(0).Value) Then
Set lvItem = Listview1.ListItems.Add(, , rs.Fields(0).Value)
For lngI = 1 To rs.Fields.Count - 1
lvItem.ListSubItems.Add , , rs.Fields(lngI).Value
Next lngI
End If
rs.MoveNext
Loop
End If
Can some please help me? thanks in advance..