MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Need Help VB App Speed and Findresult Error

This is a discussion on Need Help VB App Speed and Findresult Error within the MapPoint 2006/2009 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) . ...


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 (7) Thread Tools Display Modes
  7 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-14-2007
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
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 04-17-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,094
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).
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 04-17-2007
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 122
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
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
app, error, findresult, speed


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/need-help-vb-app-speed-findresult-error-5834.html

Posted By For Type Date
MapPoint Download - MP2K Magazine This thread Refback 04-28-2007 07:07 AM
Spatial Data Importer Contest Submission - MP2K Magazine This thread Refback 04-24-2007 08:01 PM
Using MapPoint from Word, Access and Excel - MapPoint Articles - MP2K Magazine This thread Refback 04-24-2007 02:38 PM
Home Locator Sample Application - MapPoint Articles - MP2K Magazine This thread Refback 04-23-2007 10:03 PM
Creating Geocoding Exceptions for MapPoint Web Service Applications - MapPoint Articles - MP2K Magazine This thread Refback 04-19-2007 04:37 PM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 04-17-2007 01:59 PM
The Magazine for MapPoint - MP2K Magazine This thread Refback 04-16-2007 10:11 AM

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
Run-time error 2147467259 80004005 automation error ThomasB MapPoint 2006/2009 Discussion 2 02-27-2007 11:41 AM
Open Map Speed Yazzy MapPoint 2006/2009 Discussion 1 06-27-2005 10:52 AM
Speed of the service sbedin MapPoint Web Service and Virtual Earth 0 12-21-2004 10:13 AM
Excel VBA or VB6 For Speed DavidP MapPoint 2006/2009 Discussion 3 08-14-2004 05:50 PM
How to speed up MapPoint Dean MapPoint 2006/2009 Discussion 0 08-30-2002 10:16 AM


All times are GMT -5. The time now is 12:54 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