CegerXun
asked on
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?
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?
if you are ready to purchase the database then try in http://www.geodatasource.com/
FYI they are providing some free edition in http://www.geodatasource.com/cities-free.html
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you for your interest. i really appreciate it.
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.OL EDB.4.0;Da ta 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.
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.OL
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.
http://dir.yahoo.com/Regional/Countries/
http://en.wikipedia.org/wiki/List_of_country_names_in_various_languages