|Verify the burning program is properly identifying the optical drive you wish to use.|
Many times an older version of a program needs to be updated in order to recognize the drive.
Another possibility is that your DVD laser has died or the lens is dirty. Can you read previously written DVD media?
If this occurrence just started suddenly then the media may be the problem and a firmware update may be required if available.
After rereading your original post I see the issue is with BOTH CD & DVD media. The likely hood of both lasers or lenses being a problem is not to likely. That said, I would tend to think your need to go to the website of your optical burner and update the list of recognized drives.
If you can't read any previously burned, or commercial disks then the issue may be Windows related. If that is the case, verify that by booting to a bootable disk. You can abort the process after your verify the drive can read disks before Windows starts.