By the sound of it are you using what we call the 40 pin ribbon Ide cable to connect the Cd rom drive and the Hard disk drive to the same cable, along flat like ribbon with three 40 pin blocks on it.
If so when looking at the cable you should have a Block that is colored black, the device set to master should be placed, or connected to this block.
Obviously you can set four devices up to the cables two as slave, two as master devices. so IDE 1: Master, Black: Slave device,grey. IDE 2: Master,black : Slave device Grey.
If you place them on the wrong blocks the computer will not be able to detect the devices properly. Also make sure you enable both of the IDE control interface devices within the bios.
If you are using two cables this still has to be done. Black for Master device, Grey for a Slave device. There you go problem solved...