blobber said:
OK let me rephrase hopefully better. I have a table with many
filenames. What I don't have is a table with the location. The
location will not change, the files resides on one of 3 network
drives. I am want to do just what you said which is to store in a
table in advance the location of the file. I was hoping for some
kind of easy solution. When I say index I really mean the file
locations. (I call reading and caching the file/folder locations
indexing) So what I am really looking for is a way to create a table
with all the locations of the files so that instead of trying to
search through the network drives I can just have the location in a
table and quickly link the file to the appropriate location.
So the idea is to run some process that will go through all the
filenames in your table, find out where each one is, and store that
information in the database, either in a new table or by updating the
original filename to include the path? If this is a one-time process,
the fact that the search is very broad and inefficient may not be too
much of a problem. But what if the same filename is found in more than
one location?
Which part of the process do you need help with? It's easy to open a
recordset on your table of filenames and loop through the records. Code
would be similar to this:
Dim rsFiles As DAO.Recordset
Set rsFiles = CurrentDb.OpenRecordset("tblFiles")
With rsFiles
Do Until .EOF
Call FindThisFile(!FileName)
.MoveNext
Loop
.Close
End With
In the above "FindThisFile" would be the name of a function you had
written to find the file and record its location.
Did you look at the help file entry on the FileSearch object?