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

AddPushPin Error 4013

This is a discussion on AddPushPin Error 4013 within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I am trying to programmatically add a number of pushpins to a dataset but I am failing. I am ...

  1. #1
    akthus is offline Junior Member White Belt
    Join Date
    Mar 2003
    Posts
    3

    AddPushPin Error 4013

    Hi,

    I am trying to programmatically add a number of pushpins to a dataset but I am failing.

    I am using vb6 and mappoint 2002 and the mappoint active x control.

    I get an error which says 'The requested set does not exist'

    here is the code i use

    'Create a new pushpin set.
    mappoint.ActiveMap.DataSets.AddPushpinSet "Suppliers"

    'Get the DataSet object from the pushpin set
    Set objDs = mappoint.ActiveMap.DataSets("Suppliers")
    objDs.Select
    'loop through the SQL data...
    Do While Not rs.EOF
    'Create a location object from the latitude and longitude on the database.
    Set objLocTst = mappoint.ActiveMap.GetLocation(rs!Latitude, rs!Longitude)

    'Add a pushpin

    Set objPin = mappoint.ActiveMap.AddPushpin(objLocTst, rs!Name)
    'Make sure the balloon is closed.
    objPin.BalloonState = geoDisplayNone
    'Put additional data in the note field of the pin.
    strNote = rs!AccountNumber & vbCrLf & _
    IIf(IsNull(rs!TownCity), "", rs!County & vbCrLf) & _
    rs!City & ", " & rs!Country & " " & rs!PostCode & vbCrLf
    objPin.Note = strNote
    'Cut the pin out of "My Pushpins"...
    objPin.Cut
    '... and paste into "Locations from DB"
    objDs.Paste
    'Get the next database record.
    rs.MoveNext
    Loop

    any help is welcome.

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    AddPushPin Error 4013

    Well, you don't say which line of code produces the error. However the lines:

    'Cut the pin out of "My Pushpins"...
    objPin.Cut
    '... and paste into "Locations from DB"
    objDs.Paste

    can be done more efficiently using:

    objPin.MoveTo objDs

    And that might help.

  3. #3
    akthus is offline Junior Member White Belt
    Join Date
    Mar 2003
    Posts
    3

    PushPin Error

    MichAn,

    Thanks for responding. I found out what the problem was.
    There was nothing wrong with the code that I listed but an earlier declaration where I was opening another map and adding the pushpins to another. I was not setting the reference to the correct map that was opened.

    However your suggestion about moving the pushpin is a good one and I will try it.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. addpushpin - need help to get started
    By BWard in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 12-19-2005, 02:15 PM
  2. addpushpin problem
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 09-28-2004, 09:12 AM
  3. AddPushPin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-01-2004, 10:41 AM
  4. addPushpin
    By nringdahl in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-27-2004, 09:09 AM
  5. AddPushpin
    By Monique in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-20-2002, 01:26 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