Is your programmer support the 16F877a as it can have some programming time difference.

Also, the A serie are bit much noise sensitive, be sure you place the proper psu filtering cap close to your PIC.