King Mickey's Keyblade was Star Seeker, provided by Master Yen Sid. Birth by Sleep is before KH1 so Mickey did not have his Kingdom Key D up then. In the end of BbS he passes the MoM and turns into a Master of the Keyblade. In the beginning of KHII King Mickey arives into Twilight Town from the train that leads to Mysterious Tower (my theory: he returned Star Seekers keychain to Yen Sid [that went into Sora]).
In Re:Coded if you see correctly the part when he uses is Keyblade, they (Mickey, Donald and Goofy) are already on the Datascape, and what is Datascape? Its a Data fabrication of Jiminy's Journal of KH1. Summary: Mickey used is keyblade inside the journal from the time of KH1, he used the keyblade that he used during KH1. Hope it's clarified
In Re:Coded if you see correctly the part when he uses is Keyblade, they (Mickey, Donald and Goofy) are already on the Datascape, and what is Datascape? Its a Data fabrication of Jiminy's Journal of KH1. Summary: Mickey used is keyblade inside the journal from the time of KH1, he used the keyblade that he used during KH1. Hope it's clarified