Maybe keyboard is faulty. Most of the Compaq / HP models have a reset procedure which would clear the BIOS power on password for this you may have to disassemble the laptop and perform certain reset actions.
Get in touch with HP technical support and request for a Service Manual with this reset procedure.