Key code is needed only if you lose your key.
Other codes (stereo, navigation, etc. - not sure CX9 has them - my old Odyssey had them) might be needed if you disconnect the battery. You will need to enter the codes to unlock them.
In all cases, the dealer's computer can access those codes based on your VIN.
However, if you don't do services there, your dealer might charge you for such lookup.