You'll get both og those if you unplug the TPS while in diagnostic mode. Code 51 will occur if you just tap the throttle. Code 42 will only be caused by a failure or unplugging it.
It's easy enough to get off as long as you use the right size screwdriver... Pulling the throttle body and putting it on your workbench REALLY helps.