MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Query Mappoint Visual Basic 6.0

This is a discussion on Query Mappoint Visual Basic 6.0 within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have an access database which i am using to color counties and specific states around the usa. I need ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-19-2005
Junior Member
White Belt
 
Join Date: Mar 2005
Posts: 8
Query Mappoint Visual Basic 6.0

I have an access database which i am using to color counties and specific states around the usa. I need to able to filter the database inside visual basic and display it in mappoint's method: "Display data map". The Display data map method allows me to choose a table but i have not found a way to establish parameter in its properties so i can only map the filtered information. Any help on that would be grealty appreciated.

The code below maps everything together, however i need to be able to filter the field practice code to a specific value before submitting the information to mappoint.

'---Similar to the Pushpin version, the following code display a shaded data map on the screen

Dim objMap As MapPointCtl.Map
Dim szconn As String
Dim objDataSet As MapPoint.DataSet
Dim objDataMap As MapPoint.DataMap
Dim objField As MapPoint.Field
Dim lRangeValues(1 To 5) As Variant
Dim zRangeNames(1 To 4) As String
Dim lColorRange As Long
Dim objPin As MapPoint.Pushpin
Dim rs As ADODB.Recordset
Dim sSql As String


Set objMap = MappointControl1.NewMap(geoMapNorthAmerica)
Set objMap = MappointControl1.ActiveMap

With objMap.DataSets
szconn = "C:\Silveus\MapPoint\Texas\Texas.mdb!Texas997"
Set objDataSet = .ImportData(szconn, , geoCountryUnitedStates, , geoImportAccessTable)

Set objField = objDataSet.Fields("practicedescription")

Set objDataMap = objDataSet.DisplayDataMap(geoRangeTypeUniqueValues , objField, _
geoShowByRegion2, , _
geoRangeTypeDiscreteEqualRanges, _
, _
lColorRange)
End With
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-07-2005
calv1ns's Avatar
Member
Green Belt
 
Join Date: Mar 2005
Posts: 91
I think Richard answered this same question recently. The approach is to do your filtering in Access before you do the .ImportData to MapPoint. In your case create a query in Access that selects the rows you want from table "Texas997." Set szconn (DataSourceMoniker) to the name of the new query and then use geoImportAccessQuery as the ImportFlags.

If you run into trouble check the help files in MapPoint Programming Information - there are a couple examples there.

Ciao,
__________________
Calv1ns
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 10-08-2005
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 899
Blog Entries: 10
Yes that would be my approach.

I haven't done much work with color shaded plotting and ImportData, but datasets are read-only. Even user-imported pushpin sets!


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
basic, mappoint, query, visual


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
mappoint, visual c++ vs visual basic Anonymous MapPoint 2006/2009 Discussion 6 03-30-2004 10:17 PM
Control of MapPoint 2002 using Visual Basic .Net DogsWorld MapPoint 2006/2009 Discussion 1 02-26-2004 11:53 PM
Visual Basic. NET and MapPoint Anonymous MapPoint 2006/2009 Discussion 1 07-30-2003 03:49 PM
Visual basic or visual c++ in mappoint misterb83 MapPoint 2006/2009 Discussion 1 02-14-2003 09:31 AM
I am using MapPoint 2001 and Visual Basic(6.0). I.... Anonymous MapPoint 2006/2009 Discussion 2 06-10-2002 09:33 AM


All times are GMT -5. The time now is 11:25 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54