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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,213,551
Messages
6,114,272
Members
448,558
Latest member
aivin

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