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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check cd drive letter

Status
Not open for further replies.

instructorTek

Instructor
Jun 5, 2006
61
Hi good day to all. I have an app done in MS Access 2002. Is there a way to determine the drive letter of the cdrom drive using VBA or using the windows API. I'm trying to determine this in the onClick event in a form.
Thanks in advance.
 
You can use the File System Object of the Windows Scripting Host to determine the type of any drive:

Code:
set fso = CreateObject("Scripting.FileSystemObject")
for each drv in fso.Drives
  if drv.drivetype=4 then
    msgbox (drv.driveletter & " is the CD")
  end if
next

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top