So both are detected by the BIOS but you cannot eject the DVD ROM, correct? Is the CD ROM connected to the secondary IDE cable? Set the jumper on the CD ROM to cable select. Put the ROM at the END of the Secondary IDE cable. Make sure the other end of the IDE cable is connected to the motherboard. Perhaps you are not sending power to the CD ROM via the plastic connector power plug. Possible bad IDE cable or powersupply.
Also reset the CMOS battery on the motherboard.