I think you are talking outside the case, and i am talking about from outside the case to inside the case, on the motherboard.
On the motherboard, you will find that the on\off switch that is on the outside of the case, is connected somewhere on the motherboard, on the inside of the case. In that block of pins would be 4 pins set aside for you to connect a simple small speaker to, and that would be all you need to do.
Provided that you have a speaker, and you have located the place on the motherboard where the on\off power is connected to the motherboard, you can try connecting this speaker to any 4 pins on that block for your speaker. One block of 4 pins would be for the speaker.
You could likely go to compaq website and find out exactly where the pins are, but you can find out thru trial and error as i suggested. If Compaq site fails you then go to motherboards.com and they may have a schematic of your motherboard, but again, I dont see a need.
You must be able to go to the back of the computer and take the screws off so you can gain access to the motherboard?
Good advice + great people = tek-tips