Is this the original drive that the ComPaq came with? Do you have the burning software and not just the ComPaq restore disks?
If you do have the software for the burner, here's something to try:
Go to Device Manager and click on 'remove' the drive. I believe that choice will be found as a right click on the drive under cd drives. Then reboot and reinstall the software after XP reinstalls the generic atapi drivers. If this gains nothing, try a cd-rom cleaning disk. Not one for cleaning disks but the one for cleaning the drive. If still no-go, the drive may be on it's way out and a new one would more likely be your only choice.
An alternative to reinstalling via restore disks is to take the harddrive out and slave it in another pc to retrieve your files, then put it back and run the restore cd's.
I'd love to suggest that you just get an XP cd and install that instead but some Comcraps have hidden partitions with BIOS information and it requires the original configuration to work.
My opinion is that the drive is weakening and on it's way out. CD and DVD burners are very inexpensive these days and most times come with burning software bundled with them. They would be compatible with your Compaq just fine.
There's no place like 127.0.0.1