I'm not absolutely sure that this will work for a Compaq but its worth a shot. The reason it might not work is that Compaq and other OEMs like them usually build their own motherboards and evil junk they've put on it.
Important!: Before attempting this make sure you understand all the BIOS settings and can set them up yourself. Having the manual might help and might not depending on if Compaq.
What we are going to do will cause the BIOS to revert to its factory default settings. (That's if the Compaq board works like every other board I've ever seen.) Sometimes there is a jumper on the motherboard that will reset the BIOS. Hunt around and look for it. If there isn't one no big deal. The answer to our problems is simple. Unplug the computer from powersources (the wall, UPS, etc.). Now remove the battery that is on the motherboard. It will look somewhat like a watch battery.
TA-DA! The motherboard now will forget everything ever told to it about passwords. Wait a few seconds to make sure all the electricity has time to throughly disapate. Now, put the battery back and fire the thing up. Go into you BIOS and enter in the settings that you need. That should be all you have to do to solve the BIOS password problem.
Of course, this will not help with NT passwords.