Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Query Mappoint Visual Basic 6.0

This is a discussion on Query Mappoint Visual Basic 6.0 within the MapPoint Desktop 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 ...

  1. #1
    virgilar is offline 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

  2. #2
    calv1ns's Avatar
    calv1ns is offline 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

  3. #3
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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