Copy Backend to Flash Drive

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Rather then using BrowseFolder code to select the flash drive folder location
(since this will be the default target location), I need to determine what
drive that the flash is in. Using this location info, I will then use
filecopy to copy the backend.

How can I determine the location of the flash drive?

(I don't believe that I can always assume the the flash drive will be
located at the Removable Disk (E) drive)


The user will always be saving the backed to a flash drive.
 
I'm not sure what's the best way to do this.

One approach would be to write code to create a FileSystemObject object
and iterate through its Drives collection until you find a removable
drive (DriveType = 1) whose IsReady property is true. This makes it at
least a candidate for being your flash drive.

If it's always going to be the same flash drive, you could then check
its VolumeName property (having previously formatted the drive with a
distinctive name such as DB_BACKUP) to make sure it's the right one. Or
you could have your code read the drive's root directory to see if it
already contains a copy of the back end. Or whatever appeals.

If this is the right drive, you can go ahead; otherwise, continue
iterating the Drives collection until you find the next ready removable
drive.
 
Back
Top