As for Casino Royale, it is very much a reboot creating a new continuity, and is not about someone assigned a code name. Bond is a single agent inhabiting a floating timeline, where he remains at one age while the world moves around him. (At any rate, the movie later has a scene where Bond reminisces about his former missions, something he couldn't do if he was a different person with a new code name.) Over the series, there are many scenes where Bond runs into old friends who recognize him as Bond, and in Skyfall we see the graves of Bond's parents, Andrew and Monique Bond. Many point to the opening scene of 'On Her Majesty's Secret Service' where George Lazenby as Bond says, as a girl runs away from him, 'This never happened to the other fellow,' but that was intended as a one-off joke to the audience about how it was a new actor in the role. It is never explicitly stated or even implied in the films that 'James Bond' is a code name, and there is little to nothing in the films to indicate the code name idea is valid. However, there is not in the novels at all, which are about an agent whose real name is James Bond.
Some have even claimed that this is an idea from the novels. Over the years, some fans have come up with the idea that there is no one 'James Bond,' that it's merely a code name assigned to a series of agents, as a way of explaining why Bond never seems to age and has continued for nearly half a century.