[thelist] sorting recordset problems

Pringle, Ron RPringle at aurora-il.org
Wed Jan 4 13:59:15 CST 2006


Hello all-

Using classic ASP/VBScript, I've created a recordset using FileSystemObject
to grab a listing of PDFs from a directory. All is well and good, except I
need to sort the resulting records by part of the file name, specifically
the month and day, which are written in the middle of the file.

An example file name is: ctyJan122005agd.pdf

I need to sort by Month (most recent month first) and then by day. So if I
had two records with the names as below, they would sort with the June one
first:

ctyJun232005agd.pdf
ctyJan122005agd.pdf

Right now, all I do is create a recordset with one field called "name" which
holds the file name, and I sort it by Ascending. Obviously doesn't give me
the results I want.

Not adding the files to a recordset and simply outputting them via a loop
just gives me the files in whatever order they appear in the directory.

Any ideas or links to further reading? Not sure what to even Google for to
get an answer to this one.

Regards,
Ron



More information about the thelist mailing list