Results 1 to 3 of 3

Thread: Listview and multiple tables?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Location
    Down
    Posts
    2

    Question Listview and multiple tables?

    Hi, this is my first thread and I'm pretty new to vb6.

    At present I'm working on a search function using a listview.

    Could someone tell me if there's a way to use multiple tables to populate the listview.

    Heres my atttempt.

    Private Sub Form_Load()
    Call Connect
    check_rs
    rs.Open "select * from music", cnn
    rsPub.Open "select * from Publishers", cnn

    fill_list
    End Sub


    Public Sub fill_list()
    ListView1.ListItems.Clear
    If rs.RecordCount = 0 Then Exit Sub

    While Not rs.EOF

    Set lst = ListView1.ListItems.Add(, , rs(0))
    For eX = 1 To 12
    lst.SubItems(eX) = rs(eX)



    Next eX
    rs.MoveNext

    Wend
    End Sub

    No joy though. Error 3265.

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Listview and multiple tables?

    VB Code:
    1. Public Sub fill_list()
    2.     ListView1.ListItems.Clear
    3.     Dim lst As ListItem
    4.     If rs.RecordCount = 0 Then Exit Sub
    5.    
    6.     While Not rs.EOF
    7.        
    8.         Set lst = ListView1.ListItems.Add(, , rs(0))
    9.         For eX = 1 To 12
    10.             lst.ListSubItems.Add , , rs(eX)
    11.            
    12.         Next eX
    13.         rs.MoveNext
    14.        
    15.     Wend
    16. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Location
    Down
    Posts
    2

    Re: Listview and multiple tables?

    Thanks mate I'll try that!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width