Hi all. i am using the following code to populate my listbox. I wonder how i can modify it so i populate listview instead. My query for listbox outputing one item but for my listview has to output more then one item. I be happy if some one show me how this can be done.Thanks

qury for the listview:
select url,author,image,title from videos2
2 Code:
  1. Private Sub Form_Load()    
  2.    
  3.    
  4. 'Open connection
  5. Dim CNN As ADODB.Connection
  6. Dim RS As ADODB.Recordset
  7. Set CNN = New ADODB.Connection
  8. CNN.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=test;USER=root;PASSWORD=;OPTION=3;"
  9. 'get records to recordset
  10. Set RS = CNN.Execute("select url,author,image,title from videos2", , adCmdText)
  11.  
  12. 'go through all the records until you get to
  13. 'the end (rs.EOF = True)
  14. Do Until RS.EOF = True
  15. 'Add the records to your listbox
  16. 'ShowScrollBar List2.hwnd, SB_HORIZONTAL, True
  17. List2.AddItem RS!URL
  18. 'start from the first record and then go through them all
  19. 'using .MoveNext
  20. RS.MoveNext
  21. 'get all records (loop)
  22. Loop
  23.  
  24. RS.Close
  25. Set RS = Nothing
  26. CNN.Close
  27. Set CNN = Nothing
  28.  
  29.  
  30.  'horizantal scroll bar
  31.       'List1.AddItem "set the right margin to 3 times the width of the control"
  32.    
  33.     SendMessage List2.hwnd, LB_SETHORIZONTALEXTENT, ScaleX(List2.Width * 3, Me.ScaleMode, vbPixels), 0
  34.     ShowScrollBar List2.hwnd, SB_HORIZONTAL, 1
  35.    
  36. End Sub