Selecting Database

  • Thread starter Thread starter Noemi
  • Start date Start date
N

Noemi

Hi

I would like to be able to select a database using explorer and then be able
to reference back to the database I select.

What I need to be able to do is click on a button which will then ask me to
select the database I require. Once the database has been selected another
message will ask me to select the folder where files are located.

Once I have solected both the database and the folder of files, I would like
to have the program run through all the additional folders (if any) and have
a look at the type of files in the folder. If there are pdf's then I want to
look up the file name in a table within the database I have selected and
changed a field for the record from TIF to PDF.

Any help would be appreciated as I have not had to look up folders and
databases in this way before.

Thanks
Noemi
 
Hi Allen

Thanks for your help.

I was hoping you might be able to help me with another part.

When the user selects the folder they wish to check for pdf's, how can I
make sure that the folders and directory before the selected folder are not
shown.

Reason for this is I would then be able to get the subfolders and file name
checked in my access database table while with the dir and other folders I
cannot.

ie: path is c:\Main Folder\Folder 1\Folder 2\Folder3\file

user selects Folder 2 therefore I would like to set against a variable the
following:
folder 2\folder 3\file.

I hope this makes sense.

Thanks
Noemi
 
The API call will return the full path to the folder. I take it you have a
text field, and you want to store a relative path only.

Assuming you know the root of the path, it's easy enough to parse what comes
after that. Let's assume the API call gave you strFile containing:
"c:\Main Folder\Folder 1\Folder 2\Folder3\file"
and you know the first part of the path in strRootPath is:
"c:\Main Folder\"
then you code:
strFile = Mid(strFile, Len(strRootPath) + 1)

If that's not what you are doing, I did not understand the question.
 
Hi Allen

It is sort of correct however the location of the folder which is selected
originally can vary
ie
Let say that the user selected folder 2 from the example below
c:\Main Folder\Folder 1\Folder 2\File

now, user selects folder 3
c:\Main Folder\Folder1\Folder2\Folder 3\Folder 4\File

Is there a way to have code see the folder name selected and then show the
folder names (if any) after it including the file name.

I hope I have not confussed you.

Thanks
Noemi
 
I don't understand how to determine which is the top-level folder to retain.

If you can determine that, you can chop the string where you want it.
 
Back
Top