I have two questions related to displaydatamap. The following code populates the map with data from mappoint. I would like to populate the map using the same displaydatamap settings below but using data from an access database. I have two fields in the database, one for state and another for value.
1 Question - how do i populate the map using access data?
2 Question - Do i have to open the application in order to show the changed map? (i would like to display the changes in visual basic only)
Here is the code i have so far, it works with data from mappoint. However i would
like to insert my own from access and display in visual basic only. Any help would be grealty appreciated.
Dim objDataSet As MapPoint.DataSet
Dim objDataMap As MapPoint.DataMap
Dim objField As MapPoint.Field
Dim objApp As New MapPoint.Application
Dim lRangeValues(1 To 5) As Variant
Dim zRangeNames(1 To 4) As String
Dim lColorRange As Long
Dim szconn As String
objApp.Visible = True
objApp.UserControl = True
lRangeValues(1) = 0
lRangeValues(2) = 10000000
lRangeValues(3) = 20000000
lRangeValues(4) = 30000000
lRangeValues(5) = 40000000
zRangeNames(1) = "Low (< 10 million)"
zRangeNames(2) = "Medium (10 to 20 million)"
zRangeNames(3) = "High (20 to 30 million)"
zRangeNames(4) = "Really High (over 30 million)"
lColorRange = 15 'full spectrum
Set objDataSet = objApp.ActiveMap.DataSets.GetDemographics
Set objField = objDataSet.Fields("Population (2000)")
Set objDataMap = objDataSet.DisplayDataMap( _
geoDataMapTypeShadedArea, objField, _
geoShowByRegion2, geoCombineByDefault, _
lColorRange, 4, lRangeValues, zRangeNames)
objDataMap.LegendTitle = "States shaded by population"