Help with using FSO to create a recodset of files

Results 1 to 3 of 3

Thread: Help with using FSO to create a recodset of files

  1. #1
    Gene Kim Guest

    Default Help with using FSO to create a recodset of files

    I am using ASP to query a database that retrieves a list of picture filenames in a recordset. (The actual pictures are stored on the server) I then display the list of picture filenames to the user, so the user can select what picture to view. <BR><BR>I would like to use FSO to create a recordset of files (pictures) in a directory on my server so I can then perform a "left outer join" query against my database query. Thus, pictures that are in my database, but not physically on the server would not display in the record results.<BR><BR>Any help would be appreciated.<BR><BR>Thanks!<BR>--- This is the code I use to get the list of files.<BR>Set objFSO = server.createobject ("Scripting.FileSystemObject")<BR>Set objFolder = objFSO.GetFolder(strImageFolder)<BR><BR>For Each objFile in objFolder.Files<BR> response.write "&#060;option value=" & objfile.Name & "&#062;" & objfile.Name<BR>next<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Do you mean a *TABLE*?

    You can&#039t create a RecordSet from FSO.<BR><BR>Doesn&#039t even make any sense.<BR><BR>A RecordSet is *actually* just the results of a query in the DB. It doesn&#039t represent any "real" data set, at all. It might be comprised of just one field or it might contain many fields from many different tables.<BR><BR>If what you mean is that you would like to "ask" FSO what files a given directory contains and, from that, build a *TABLE* in the DB that reflects that list, then that&#039s pretty easy.<BR><BR>How would you trigger on *WHEN* you would rebuild the table? You certainly wouldn&#039t want to do it every time somebody hits the page! Way too much overhead.<BR><BR>

  3. #3
    Gene Kim Guest

    Default RE: Do you mean a *TABLE*?

    Bill,<BR><BR>I&#039m sorry if I wasn&#039t clear. I did mean a recordset at first. However, thinking about it a little more, it would be alot of overhead. I will build a table with the list of files. Then I can query that table. I will have a page that triggers the rebuilding of the table and call the trigger whenever new images are uploaded.<BR>Thanks for the redirection.<BR><BR><BR>

Posting Permissions

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