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

Optimize and calculate a Route

This is a discussion on Optimize and calculate a Route within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, I have an ACCESS-table with maybe 30 addresses and would like to optimize and calculate a route with VB. ...

  1. #1
    rms62 is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    9

    Optimize and calculate a Route

    Hello,
    I have an ACCESS-table with maybe 30 addresses and would like to optimize and calculate a route with VB. Has anyone an idea?
    Thanks
    Ralf

  2. #2
    rms62 is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    9
    I found it by myself:


    Private Sub Befehl0_Click()
    Dim objApp As MapPoint.Application
    Dim objMap As MapPoint.MAP
    Dim objRoute As MapPoint.Route
    Dim db As Database, rs As Recordset, i As Integer, Status As String
    Set db = CurrentDb
    Set rs = db.OpenRecordset("KundenXLS")
    'Anwendung einrichten
    Set objApp = CreateObject("mappoint.application")
    Set objMap = objApp.ActiveMap
    Set objRoute = objMap.ActiveRoute
    objApp.Visible = True
    objApp.UserControl = True
    'Route erstellen und optimieren
    With objRoute.Waypoints
    do until rs.eof
    .Add objMap.FindAddressResults(rs!Straße, rs!Ort, , , rs!Plz, geoCountryGermany).Item(1)
    rs.MoveNext
    Loop
    End With
    objRoute.Waypoints.Optimize
    MsgBox "Die Route wurde optimiert"
    objRoute.Calculate
    End Sub


    It works fine but is there also a way to get back to ACCESS the distances from every point to the next?
    Thanks to everyone

    Ralf

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    There is an itenary collection that gives you more information on each segment including time and distance.
    Back to the route optimize method, do you know of a similar method in mappoint 2003 (web service ) ???
    Regards,
    Rasmeek

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Handling Route that Calculates but does not Optimize
    By Eric Frost in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-07-2005, 03:07 PM
  2. How do I calculate a route distance without displaying route
    By spideybud in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 09-09-2003, 11:14 AM
  3. Optimize a Route with Scheduled Time windows
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-09-2003, 07:20 AM
  4. Calculate route with Segment preferences vs optimize
    By David Kachuck in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-03-2003, 04:29 PM
  5. Route optimize: shortest vs quickest
    By David Kachuck in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-16-2002, 08:23 PM

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