[thelist] combining recordsets (WAS - sorting recordset problems)

Pringle, Ron RPringle at aurora-il.org
Thu Jan 5 10:12:24 CST 2006

Following on my previous post, I renamed all the files so that they properly
conform to standard date naming conventions, which makes sorting a lot
easier. The files now follow a naming convention of xxxMMDDYYYYzzz.pdf where
xxx is the 3 digit committee code and zzz is the 3 digit type code (either
agd for agenda or min for minutes).

The next problem I've encountered is:

Minutes and Agendas are in two separate directories. Currently I create two
on-the-fly recordsets to hold the results from each directory. I want to
combine the two recordsets into one by comparing the first 11 places of the
filename string, and if they match, join them into one record. This is so I
can display the Agendas and Minutes for any given date next to each other if
both exist. If only one exists, then it should just display the one with a
blank table cell for the other.

Creating recordsets on the fly is new to me, I've only ever worked with
creating recordsets from DB connections.

Exactly how do I create the combined recordset? Do I append one to the
other, or create a new recordset based on a JOIN of the two previous

Below is the code I've used to create the Agenda recordset (with an
identical Minutes recordset named rsFSOMinutes):

'create recordset
Set rsFSOAgenda = Server.CreateObject("ADODB.Recordset")
With rsFSOAgenda.Fields
.Append "Name", adVarChar, 200
.Append "URL", adVarChar, 200
.Append "Size", adInteger
End With

'populate it
For each objFile in objFolder.Files
rsFSOAgenda("Name") = objFile.Name
rsFSOAgenda("URL") = linkPath
rsFSOAgenda("Size") = objFile.Size

'write results
rsFSOAgenda.Sort = "Name ASC"
While Not rsFSOAgenda.EOF
[...Write results in HTML Table...]
Set rsFSOAgenda = Nothing

Apologies for the long post.


More information about the thelist mailing list