Few things to try here, first off I would change the cmos battery on the motherboard (available anywhere that sells watch batteries or electronics parts, just take it with you to make sure you get the right one, should only cost a few quid) If it keeps losing its settings it could be that.
As for the hard disk not being detected, it usually happens when 2 devices on IDE 1 or 2 are both set to master or slave (either both master or both slave). Now taking that onboard it could suggest a faulty jumper on the back of the device possibly, not making the connection properly. On most devices if there isnt a jumper present it will default to setting the device to master. So what I will suggest for you to try is to grab an old motherboard or part that has jumpers on it and replace the jumper on the back of the hard disk and also replace the jumper on anything that is slaved to it with said spares from old parts.
Give both these a try and let us know how you get on. Go for the battery first as I would personally say that it will most likely be that if the cmos keeps losing its settings, ideally you should replace the cmos battery once a year.
BTW : Dont touch the new battery with you're fingers as it will lose its charge, pull the backing off and put it in using either a pair of tweezers or keeping it in part of the packing and fit it that way.