• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2749
  • Last Modified:

I need the name of all countries and cities

Hi there,

As seen on title I need the name of all countries and cities around the world. I must use that in my application with selection box.

Could you please guide me how to achieve this issue?
0
CegerXun
Asked:
CegerXun
  • 5
  • 2
1 Solution
 
Shanmuga SundaramDirector of Software EngineeringCommented:
0
 
Shanmuga SundaramDirector of Software EngineeringCommented:
if you are ready to purchase the database then try in http://www.geodatasource.com/
0
 
Shanmuga SundaramDirector of Software EngineeringCommented:
FYI they are providing some free edition in http://www.geodatasource.com/cities-free.html
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CegerXunAuthor Commented:
i think you misunderstood me. i need their names in any data file like xml. because i will use them in my app.  i dont need their geographical datas i just need their names. but it must be for free. i am not ready for purchase.
0
 
Shanmuga SundaramDirector of Software EngineeringCommented:
The second link will give you the detailed list of country and cities in a text file. hope it is approx 8 MB. you can download that text file from free and convert it into xml. I am sure that this will help you. Because after seeing your post I downloaded it and found it can be done with ease. Thanks for your post, because I got data with the city and country names on searching for your need. Better try since it is free
0
 
CegerXunAuthor Commented:
thank you for your interest. i really appreciate it.
0
 
Shanmuga SundaramDirector of Software EngineeringCommented:
I worked for you. I will say how I did it convert the text file to xml. First I downloaded the Zip from the above said link for free. Then I extracted the files GEODATASOURCE-CITIES-FREE.TXT and GEODATASOURCE-COUNTRY.TXT from the zip. Then I opened MSAccess. There I imported the above two files and saved it as separate tables. Then I created a relation ship and then created a query to insert into a new table named "citydetails" that consists only the countrycode, countryname and city name.
Then I used VB6 to convert the citydetails tables records and store it into xml. The code goes as given below.

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\shanmugasundaram\My Documents\db1.mdb;Persist Security Info=False"
rs.CursorLocation = adUseClient
rs.Open "Select * from citydetails", cn, adOpenKeyset, adLockOptimistic
rs.Save "c:\city.xml", adPersistXML
MsgBox "finished"
End Sub

Finally I zipped that file and now stored via http://www9.sendthisfile.com. You can find the zipped file in this link that consists of the XML data. Please note, it takes more time to open since its size is nearly 10MB.

http://www9.sendthisfile.com/d.jsp?t=7e4wUVjpWLR81b1BS0nrZYRh

I tried my best to help you. Thanks for your points.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now