This problem is known by Microsoft. The following link will show you how to resolve it.
You can no longer access the CD drive or the DVD drive, or you receive an error message after you remove a CD recording program or a DVD recording program in Windows XP: "error code 31"