CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    5

    Adding filenames to a recordset

    I am selecting multiple files from a FileListBox and displaying them in a ListBox in one form. Now I would like to put this list of filenames in a recordset in a different form. Any ideas on the code to accomplish this?


  2. #2
    Join Date
    Jan 1999
    Posts
    24

    Re: Adding filenames to a recordset

    Hello,
    It is easy!
    First, declare a Recordset variable so that both Form can se it (in a standard module)

    Public rsFiles as ADODB.Recordset

    '<<Code in form with listbox>>
    Private sub PutFileNameToRs()
    with rsFiles
    .Fields.Append "FileName",adBSTR,200
    'You can append more field
    .Open 'Open this Recordset

    'Loop here to add all ListBox item to
    'this recordset
    '''''Use code like that
    .Addnew
    .Fields("FileName")="ListBox Item here"

    End with
    End sub

    Bye,
    H.Q.Cuong


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