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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shanmuga SundaramDirector of Software EngineeringCommented:
Shanmuga SundaramDirector of Software EngineeringCommented:
if you are ready to purchase the database then try in http://www.geodatasource.com/
Shanmuga SundaramDirector of Software EngineeringCommented:
FYI they are providing some free edition in http://www.geodatasource.com/cities-free.html
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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.
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CegerXunAuthor Commented:
thank you for your interest. i really appreciate it.
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.


I tried my best to help you. Thanks for your points.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.