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

Need Help VB App Speed and Findresult Error

This is a discussion on Need Help VB App Speed and Findresult Error within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am creating a VB application that searches for matches of Office locations to a user suplied address -objLOC(1) . ...

  1. #1
    pcigreg is offline Junior Member White Belt
    Join Date
    Apr 2007
    Posts
    1

    Need Help VB App Speed and Findresult Error

    I am creating a VB application that searches for matches of Office locations to a user suplied address -objLOC(1) . I am looping through an access db and Pushpining the office Locations. There are roughly 100 locations and maybe 30 meet the 25 mile critera, but it takes around 30 seconds to do this. Is this normal?

    Also if the address is bad, like say a PO Box instead of a street address, it bombs out with a " MEthod Find Address Results of Object_Map Failed " error, shouldn't it just find it with a bad result quality?

    Here is the code

    Do Until rsA.EOF

    Set objFIND = Me.MappointControl1.ActiveMap.FindAddressResults
    (rsA! aglocstradr, rsA!agloccity, , rsA!agloczip)
    If objFIND.ResultsQuality <> geoFirstResultGood Then GoTo Nextone
    Set objLoc(x) = objFIND.Item(1)
    If objLoc(1).DistanceTo(objLoc(x)) > 25 Then GoTo Nextone
    Set objPIN(x) = MappointControl1.ActiveMap.AddPushpin(objLoc(x), rsA!agname)
    objPIN(x).Symbol = 25
    x = x + 1

    Nextone:

    rsA.MoveNext
    Loop

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Need Help VB App Speed and Findresult Error

    Hi,

    Please set next time your code between [ code] [ /code] tags for better readability.

    You should do a few additional checks. First of all you should sheck if the item is a Location object (because it also can be a Pushpin object). Then if it is a Location object. Then you can see if it is a valid address by checking the StreetAddress property. It can be null (I think Nothing in VB). But you can also check the Type property for this (Look for GeoShowDataBy in the help), but checking StreetAddress should be ok also.

    About speed, try to figure out whitch line of code take the most time to see what we can speedup. If the DistanceTo take time then you can write this yourself, and if it is the adding of pushpins then you can use a file to add them all at once. But I think it is the FindAddressResults that take the most time. There is a windows API call GetTickCount that you can use to measure the time (milliseconds, but is sufficient in this case).

  3. #3
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Location
    Battle Creek, Michigan
    Posts
    136

    Re: Need Help VB App Speed and Findresult Error

    You should create a base pushpin map with all your office locations as pushpins (instead of forcing mappoint to geocode the offices each time you do a search.)

    When performing the search, geocode the starting (customer) address, and create a radius around it. Then use the QueryCircle() method to find all office locations within a 25 mile radius.

    HTH
    Paul

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run-time error 2147467259 80004005 automation error
    By ThomasB in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-27-2007, 12:41 PM
  2. Open Map Speed
    By Yazzy in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-27-2005, 11:52 AM
  3. Speed of the service
    By sbedin in forum Bing Maps and MapPoint Web Service
    Replies: 0
    Last Post: 12-21-2004, 11:13 AM
  4. Excel VBA or VB6 For Speed
    By DavidP in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-14-2004, 06:50 PM
  5. How to speed up MapPoint
    By Dean in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-30-2002, 11:16 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 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96