DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How can i use list view to display my query result

  1. #1
    Nelson Guest

    How can i use list view to display my query result



    Can anyone tell me how i can use list view to display my query result in
    VB



    Set rst = dbs.Opendatabase("SELECT * FROM students WHERE town = 'London'")




    Any help will be apprecited


  2. #2
    Dean Earley Guest

    Re: How can i use list view to display my query result

    > Can anyone tell me how i can use list view to display my query result in
    > VB
    >
    > Set rst = dbs.Opendatabase("SELECT * FROM students WHERE town = 'London'")


    You would need to fill it manually

    Private Sub UpdateResults()
    Dim RS As Recordset
    Dim Item As ListItem

    Set RS = DB.Execute("SELECT [ID], [Name], [Enabled], [Single], [Subject], [DaysLower], [DaysUpper] FROM Emails ORDER BY [Single]
    DESC, [DaysLower], [Name];")
    Emails.ListItems.Clear
    Do While Not RS.EOF
    Set Item = Emails.ListItems.Add(, "E" & CStr(RS!ID), NoNull(RS!Name))
    Item.SubItems(1) = NoNull(RS!Subject)
    Item.SubItems(2) = IIf(RS!Single, "Single", CStr(NoNull(RS!DaysLower)) & IIf(RS!DaysLower = RS!DaysUpper, "", " - " &
    CStr(NoNull(RS!DaysUpper))))
    Item.SubItems(3) = IIf(RS!Enabled, "Yes", "No")

    RS.MoveNext
    Loop
    RS.Close
    End Sub

    the Emails object being the listview

    --
    Dean Earley (dean.earley@icode.co.uk)
    i-Catcher Development Team

    iCode Systems



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center