Don't know if the hard reset removes the security code or not, it's a pretty stupid security method if it does!
Hard reset (all data will be erased):
1. Switch off the phone.
2. Hold down the following three buttons: Green (the call answer button), * button, and '3' button.
3. While holding these buttons, press the power button and switch on the phone.
4. Release when the phone shows the nokia logo or shows other signs of life like the language selection screen.