Community of VE/MapPoint Users and Developers
This is a discussion on Automating Access and Mappoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have a client who I built an Access database for. The systems manages a days worth of client appointments, ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Automating Access and Mappoint Does anyone have experience with this or sample code I can check out. Although I'm good with Access, I've never used Mappoint before. Any help would be appreciated. Robby |
| |||
|
Hi, If you do a search on this forum to VBA, Excel, Access, .. it should give you already some articles to start. You have 2 approach, taht is using the object model where you use Mappoint for calculations eventually invisible, The other is the ocx control that you can drop on a form. But dont hesitate to ask here when you get into some problem
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| ||||
|
There's a few articles that come to mind on MP2Kmag that can help you get started -- Tracking P.F. Chang’s in the Midwest - MapPoint Articles - MP2K Magazine Home Locator Sample Application - MapPoint Articles - MP2K Magazine Using MapPoint from Word, Access and Excel - MapPoint Articles - MP2K Magazine You could probably use any one of them to get started, but you will probably like the examples of all three. Eric |
| |||
| Re: Automating Access and Mappoint
I used the HomeLocator sample and learned much from it. The problem is that it just displays the multiple locations on the map but doesnt plan the route. I can do this manually but would rather have it done for me. How can I extend the sample code to automatically include the route. Thanks |
| |||
| Re: Automating Access and Mappoint
Hi, Code: // set start point
Location loc = map.GetLocation(Lat, Lon, Alt);
wp = route.Waypoints.Add(loc, "");
wp.SegmentPreferences = GeoSegmentPreferences.geoSegmentPreferred;
// set waypoints
loc = map.GetLocation(Lat, Lon, Alt);
wp = route.Waypoints.Add(loc, "");
wp.SegmentPreferences = GeoSegmentPreferences.geoSegmentPreferred;
// set end point
loc = map.GetLocation(Lat, Lon, Alt);
wp = route.Waypoints.Add(loc, "");
wp.SegmentPreferences = GeoSegmentPreferences.geoSegmentPreferred;
// set preferred roads
route.DriverProfile.set_PreferredRoads(GeoRoadType.geoRoadArterial, 0.1);
route.DriverProfile.set_PreferredRoads(GeoRoadType.geoRoadFerry, 0.1);
route.DriverProfile.set_PreferredRoads(GeoRoadType.geoRoadInterstate, 0.9);
route.DriverProfile.set_PreferredRoads(GeoRoadType.geoRoadOtherHighway, 0.6);
route.DriverProfile.set_PreferredRoads(GeoRoadType.geoRoadToll, 0.2);
// set preferred speed
route.DriverProfile.set_Speed(GeoRoadType.geoRoadArterial, 50);
route.DriverProfile.set_Speed(GeoRoadType.geoRoadInterstate, 120);
route.DriverProfile.set_Speed(GeoRoadType.geoRoadLimitedAccess, 120);
route.DriverProfile.set_Speed(GeoRoadType.geoRoadOtherHighway, 90);
route.DriverProfile.set_Speed(GeoRoadType.geoRoadStreet, 50);
route.DriverProfile.StartTime = System.DateTime.Now;
route.Calculate();
// this hide the direction form
mp.ItineraryVisible = false;
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Automating Access and Mappoint
Hello Can anyone please I've searched on this forum but i couldnt find the solution. Some people says its because of XP SP2 incompabilities. Some people says use Access 2000. The latter solution didnt work infact with the removal of SP2 underlying OS would be vulnerable which clients cant bear. I'm trying to integrate Access2003 with MP2004. What i want to do is to calculate the shortest distance between the two streets as selected in the drop down combo boxes and the map point would automatically calculate the shortest distance as soon as the two fields are populated. Any help and coding would really be admired and appreciated. regards AUR |
| |||
| Re: Automating Access and Mappoint
Hi, I have no knowledge about VBA, but did you tryed to show the form with only the activex control on it ? If this works then you are already sure all references are ok. next step is to load a map with NewMap method. Do you get that far ? Does mappoint standalone executable runs fine ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Automating Access and Mappoint
Hello Wilfried thanks for replying i' using this code on form's open event Form_testform!ActiveXCtl10.NewMap geoMapEurope this works just fine when you place a control for the first time from the toolbox and open the form at runtime and the map gets loaded in activex control, but when you close the form and reopen it again , it starts giving suspicious errors identified previously. Also my standalone mp2004 is working fine. i've read several posts, some people are successful in integrating this but i dont know whats the actual code to open it and close. May be something needs to be done when you'r closing the form , for example i'm using the following code on form's unload event Form_testform!ActiveXCtl10.ActiveMap.Saved = True I believe there's not enough issue with the code which is just intended for loading the map point but can anyone highlight on the issues regarding XP SP2 incompabilities identified previously etc. thanks |
| |||
| Re: Automating Access and Mappoint
Hi, I will try. Ok, so the first time it works ok, second time it dont. So this let met concluding that all there is needed to load is ok, because otherwise it should not load without errors the first time. So maybe something is wrong when the form is destroyed. Can you do the following test: - Open task manager and search for mappoint.exe it should not be there. if it is then kill it. - Start your application, still no mappoint.exe should be there. - Create your form where the control i sitting on. Now you should have 1 inctance of mappoint.exe in memory. - Destroy the form and check again. There should be no instances left of mappoint.exe If there is now still an instance of mappoint.exe then there is something wrong when the form is destroyed. But that we see eventually in next step.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Yes i can see an instance which gets started when my form is loaded and destroyed when my form is destroyed. So instance creation of Mappoint.exe is normal in the task manager is normal. Again when i load my form i see the run time error message 'Map point failed to load. The cause of this failure is unknown' Again i'm using Access 2003 with mp2004 using active x control 11.0 which comes with it. OS: WinXP SP2 HELP! |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Automating Mappoint using VB | vennamreddy | MapPoint 2006/2009 Discussion | 1 | 10-07-2004 05:19 AM |
| Automating Mappoint | Anonymous | MapPoint 2006/2009 Discussion | 3 | 07-26-2004 02:29 PM |
| Automating MapPoint with Perl | Eric Frost | MP2K Magazine Articles | 12 | 07-15-2004 02:44 PM |
| Automating MapPoint with Perl | Eric Frost | MapPoint 2006/2009 Discussion | 0 | 08-08-2003 05:10 PM |
| Automating MapPoint with the .NET SDK | Anonymous | MP2K Magazine Articles | 2 | 10-21-2002 05:41 PM |
Flights Lanzarote
Volcanic landscapes to explore and warm white sandy beaches to relax on. For flights to Lanzarote search Holiday Hypermarket.
Best Travel Agent
Travel Counsellors has been named the UK's Best Travel Agent at the Guardian Unlimited Travel awards.
Cheap Flight Canada
Making a cheap flight to Canada can become a reality when you book online with dealchecker.co.uk. Our simple search allows you to see for yourself who is the cheapest.
Holidays to Sri Lanka
Holidays to Sri Lanka are enriched by the glittering tapestry of culture and breath taking mountain views. Book a holiday there today!
Turkey
Before booking a holiday to Turkey check out the ULookUBook travel guide. Find out about the rich culture in Turkey before you go there to help you to make the most of your holiday.
Holiday Comparison
We can help you with holiday comparison when you check out the options at Travel.co.uk
Cheap Cyprus Holidays
Rejuvenate mind and body! Visit the Mediterranean! Cheap Cyprus holidays can be viewed at On The Beach!