Incorrect - 12345 is the default lock or security code.
The factory settings reset code for S60 models and som S40 models is *#7780# . In S40 models you can also do this from the Settings menu.
S60 phones can also be reformatted using the code *#7370# - but be warned that you need to back up personal data first otherwise it will be lost in the reformat.
Both of these codes will require the security code to complete.