First run this fix click here
and if no joy look for and remove the upper and lower filters.
Restore Missing CD/Dvd Drives
Missing cd/dvd drive
If it is showing an error code:
Code 19, Code 31, Code 32, Code 39, or Code 41
, delete the drive.
Then follow these directions for clearing the Upper/Lower Filters: (might want to print this out)
1. Click on Start --> Run --> and type in 'regedit' followed by the enter key ( if Vista Start search or windows+R )
2. Expand the "HKEY_LOCAL_MACHINE" key (looks like a folder) by double clicking it (or
3. clicking the "+" next to it.)
4. Expand the "SYSTEM" Key
5. Expand the "CurrentControlSet" Key
6. Expand the "Control" Key
7. Expand the "Class" Key
8. Please look for a key containing the following string of letter and numbers:
9. High light this key by left clicking once on it
10. On the right hand side you are looking for "UpperFilters" and "LowerFilters" under the "Name" column, once you find these please delete them by right clicking on them and choosing "delete"
11. Please exit the registry by clicking on the "X" in the top right hand corner of the screen
Reboot your computer