Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an easy way in Access 97 to detect which drive is the CD?

Status
Not open for further replies.

WhiteZiggy

Programmer
Jan 22, 2003
85
US
Hello all,

Is there an easy way in Access 97 to detect which drive is the CD?

I can use the VBA if needed, I am just stumped as to the easiest way to find out which drives are CD ROMS....

any suggestions?

Thanks,
Jeremy
WZ
 
Depending on what version of Windows and IE are installed, you probably have access to the Microsoft Scripting Runtime library. It provides a FileSystemObject class that contains a Drives collection, which in turn contains a Drive object for each drive in the system. The Drive object has a DriveType property, which for CD-ROMs has the value of the enumerated constant "CDRom".

Be aware that if you intend to distribute the database, the Scripting Runtime library may not be available on all machines. Check the MSDN library, if you have it, for the minimum Windows and/or IE versions. The library has been around a long time, so there's a good chance it'll be available, but your database may require IE 4 to run under Windows 95, for example. Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top