I have a folder on the server with several thousand image files in it.
I am using the following code to retrieve the image names associated
with a given MLS number (this is for a real estate web site):
Function MlsPicList(ByVal mls)
path = MlsPath(mls) & "*.jpg"
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
parent = fso.GetParentFolderName(path)
Set fold = fso.GetFolder(parent)
for each file in fold.Files
If Left(file.name, LEN(mls)) = mls Then
pic = MlsPicture(Left(file.name, Len(file.name) - 4), area)
temp = temp & "," & Chr(34) & pic & Chr(34)
End If
next
MlsPicList = Mid(temp, 2)
set fold = nothing
set fso = nothing
End Function
Since I can't specify a filespec with a wildcard, my code has to loop
through ALL of the filenames to find those that I need.
Beyond putting all of the filenames into an indexed database (not really
possible, the folder is updated with new and modified images hourly), is
there a faster way to get just the files that I need?
--Dave