A communication device comprising: a communication section configured to communicate with a base station; a storage means configured to store a first communications company information on a first communications company that is under contract, second communications company information on a second communications company for which roaming is allowed to be performed and third communications company information on a third communications company for which flat-rate data communication is allowed to be performed; an acquisition means configured to acquire communications company information on a communications company that is allowed to be connected at a time of connection to the base station; a judgment means configured to judge whether or not the communications company information that is acquired by the acquisition means indicates the third communications company for which flat-rate data communication is allowed to be performed; and a connection control means configured to perform connection, by a communication section, to the communications company that is indicated by the communications company information that is acquired by the acquisition means and set that data communication is allowed to be performed when the judgment means judges that the communications company information indicates the third communications company for which flat-rate data communication is allowed to be performed, and perform connection, by the communication section, to the communications company that is indicated by the communications company information that is acquired by the acquisition means and set that data communication is not allowed to be performed when the judgment means judges that the communications company information does not indicate the third communications company for which flat-rate data communication is allowed to be performed. a communication section configured to communicate with a base station; a storage means configured to store a first communications company information on a first communications company that is under contract, second communications company information on a second communications company for which roaming is allowed to be performed and third communications company information on a third communications company for which flat-rate data communication is allowed to be performed; an acquisition means configured to acquire communications company information on a communications company that is allowed to be connected at a time of connection to the base station; a judgment means configured to judge whether or not the communications company information that is acquired by the acquisition means indicates the third communications company for which flat-rate data communication is allowed to be performed; and a connection control means configured to perform connection, by a communication section, to the communications company that is indicated by the communications company information that is acquired by the acquisition means and set that data communication is allowed to be performed when the judgment means judges that the communications company information indicates the third communications company for which flat-rate data communication is allowed to be performed, and perform connection, by the communication section, to the communications company that is indicated by the communications company information that is acquired by the acquisition means and set that data communication is not allowed to be performed when the judgment means judges that the communications company information does not indicate the third communications company for which flat-rate data communication is allowed to be performed.