Hi All
I need a push again in the right direction please.
I downloaded all the EPSG codes (over 3600 of them) into a CSV File and from there I imported them into an SQLite Database.
The format is as follows: EPSG Code, Continent, Country & Grid.
If the User clicks on say "Europe", then only the Countries in Europe should show up in the Combobox, if the User clicks on "Africa", then only the Countries in Africa should show up in the Combobox, etc.
I have tried everything, but to no avail. Tried going through the Forum, but also nothing.
Here is my code:
When I select "Europe", it tells me that there is no such Column.
Thank you
Michael
I need a push again in the right direction please.
I downloaded all the EPSG codes (over 3600 of them) into a CSV File and from there I imported them into an SQLite Database.
The format is as follows: EPSG Code, Continent, Country & Grid.
If the User clicks on say "Europe", then only the Countries in Europe should show up in the Combobox, if the User clicks on "Africa", then only the Countries in Africa should show up in the Combobox, etc.
I have tried everything, but to no avail. Tried going through the Forum, but also nothing.
Here is my code:
B4X:
[/
Sub cmbContinent_SelectedIndexChanged (Index As Int)
Dim i As Int
'Select a Continent
OpenEPSG
cmbCountry.cmbBox.clear
Select Case cmbContinent.SelectedIndex
Case 0
'World
Query = "SELECT * FROM EPSGTable WHERE Continent = World"
Case 1
'Europe
'Query = "SELECT * FROM EPSGTable WHERE Continent = Europe"
Query="SELECT Country FROM EPSGTable WHERE Continent=Europe"
Case 2
'Asia
Query = "SELECT * FROM EPSGTable WHERE Continent = Asia"
Case 3
'North America
Query = "SELECT * FROM EPSGTable WHERE Continent = North America"
Case 4
'South America
Query = "SELECT * FROM EPSGTable WHERE Continent = South America"
Case 5
'Central America
Query = "SELECT * FROM EPSGTable WHERE Continent = Central America"
Case 6
'Africa
Query = "SELECT * FROM EPSGTable WHERE Continent = Africa"
Case 7
'Oceania
Query = "SELECT * FROM EPSGTable WHERE Continent = Oceania"
End Select
Dim Items8 As List
Items8.Initialize
ResultSet =CGlobals.SQL1.ExecQuery(Query) ',Array As String("Europe"))
Do While ResultSet.NextRow
Items8.Add(ResultSet.GetString("Country"))
ResultSet.NextRow
Loop
Dim cs As CSBuilder
Dim l8 As List
l8.Initialize
For i =0 To Items8.Size -1
l8.Add(cs.Initialize.size(18).Typeface(Typeface.DEFAULT_BOLD).Append(Items8.Get(i)).PopAll)
Next
cmbCountry.SetItems(l8)
ResultSet.Close
End Sub
]
When I select "Europe", it tells me that there is no such Column.
Thank you
Michael