Saving an MDB file to a removable USB Drive

gvcooper

New Member
Joined
Apr 16, 2007
Messages
4
Hi there,

I need to give the Access user a simple way to ensure the data base tables (in a separate file to the Access VBA, Forms, Reports etc) are copied to a removable memory key at the end of a session. It used to copy to a Floppy drive in A: but no longer appropriate.

Any ideas of how to identify if a removable USB drive is available and if so how to get the drive identifier.

Thanks,
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi

You can use FSO (the file system object) in VBA to loop through all of the available drives and return the drive letter and type etc. If you can guess the removable drive is usually the D: or E: drive then you could check that first. I recommend you experiment with FSO and see what it returns for the removable drive and then adapt your existing code accordingly.

This link will help:
http://www.techbookreport.com/tutorials/fso1.html

HTH, Andrew

P.S. I forgot to mention the 'DriveType' property returns a number : the value '1' represents a removable drive.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top