CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Location
    Orlando, Florida
    Posts
    17

    listview/datagrid

    Hi how do i populate a datagrid control or a list view control with records from an access database? the book i am using is not covering it, is there a site out there that can help??


  2. #2
    Join Date
    Aug 1999
    Posts
    28

    Re: listview/datagrid

    DAO Method

    Dim N As Integer
    Dim DB As Database
    Dim RS As Recordset

    Set DB = OpenDatabase("DatabaseName")
    Set RS = DB.OpenRecordset("TableName",dbWhatever)

    Do Until RS.EOF
    N = N + 1
    ListView1.ListItems.Add N,,RS![FieldName]
    ListView1.ListItems(N).SubItems(1) =
    RS![FieldName]
    (Add More subItems if needed)
    RS.MoveNext
    Loop



  3. #3
    Join Date
    Apr 2001
    Location
    Orlando, Florida
    Posts
    17

    Re: listview/datagrid

    thank u for that snippet))


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

Featured