In consideration of advancing the technology of X-ray pulsar-based navigation, a theoretical method for space-based building of navigation database is raised. This method uses locus integration of the Earth orbit to provide the analytical solution to measured parameters of navigation sources. Numerical analyses reveals that to meet the demands of navigation with hundreds of meters' accuracy, the testing database containing four pulsars can be built within two years with a 0.25 m(2) detector. For an extended database, it is recommended that X-ray binaries are included. The space-based observation data of X-ray binaries shall be collected before judging whether they will serve as navigation sources