try this sample from Kaverin,

VB Code:
  1. 'Author Kaverin
  2. 'in a module
  3. Public Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
  4. Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
  5.  
  6. Public Function GetCDDriveLetter() As String
  7.    Dim strBuffer As String
  8.    Dim astrDrives As Variant
  9.    Dim lngLength As Long
  10.    Dim i As Integer
  11.    Const CDROM As Long = 5
  12.    'make buffer
  13.    strBuffer = Space$(256)
  14.    'get all drive strings
  15.    lngLength = GetLogicalDriveStrings(Len(strBuffer), strBuffer)
  16.    'chop off the unnecessary part
  17.    strBuffer = Left$(strBuffer, lngLength)
  18.    'break up the string into the drives
  19.    astrDrives = Split(strBuffer, vbNullChar)
  20.    For i = 0 To UBound(astrDrives)
  21.       If GetDriveType(astrDrives(i)) = CDROM Then
  22.          'if the drive is a cd rom, we're done, so return the letter
  23.          GetCDDriveLetter = Left$(astrDrives(i), 1)
  24.          Exit Function
  25.       End If
  26.    Next i
  27.    'if you get to this point, there is no cd rom, so return ""
  28.    GetCDDriveLetter = ""
  29. End Function