Is there a code or other procedure one can use assuming one doesn't have a SIM card from another network to hand?

I am not talking about the keyboard being locked, I mean the phone being locked to a network.