Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
AddPushpin Error 4013
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Akhtar Hussain  
View profile  
 More options Mar 12 2003, 8:43 am
Newsgroups: microsoft.public.mappoint
From: "Akhtar Hussain" <akhtar.huss...@fmg.co.uk>
Date: Wed, 12 Mar 2003 05:42:06 -0800
Local: Wed, Mar 12 2003 8:42 am
Subject: AddPushpin Error 4013
I am trying to add a number of pushpins but every time i
use the AddPushpin method I get an erroe saying
'The requested set does not exist'

Here is my code : -

'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 at that location with a name from
the "LocationName" field on the database
       ' Debug.Print objDs.Name
        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 would be welcome.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gilles Kohl [MVP]  
View profile  
 More options Mar 12 2003, 3:41 pm
Newsgroups: microsoft.public.mappoint
From: "Gilles Kohl [MVP]" <gilles@_deletethisincludingunderlines_compuserve.com>
Date: Wed, 12 Mar 2003 21:37:50 +0100
Local: Wed, Mar 12 2003 3:37 pm
Subject: Re: AddPushpin Error 4013
Akhtar,

On Wed, 12 Mar 2003 05:42:06 -0800, "Akhtar Hussain"

I modified your code so that it does not need your data:

Option Explicit
Dim oMpApp As MapPoint.Application
Dim oMap As MapPoint.Map

Private Sub Command1_Click()
   'Create a new pushpin set.
    oMap.DataSets("Suppliers").Delete
    oMap.DataSets.AddPushpinSet "Suppliers"

    'Get the DataSet object from the pushpin set
    Dim objDs As MapPoint.DataSet
    Set objDs = oMap.DataSets("Suppliers")
    objDs.Select
    'loop through the SQL data...
    Dim I As Integer

    For I = 1 To 20
        'Create a location object from the latitude and longitude on
the database.
        Dim objLocTst As MapPoint.Location
        Set objLocTst = oMap.GetLocation(49 + I, 10 + I, 0)

        'Add a pushpin at that location with a name from  the
"LocationName" field on the database
       ' Debug.Print objDs.Name
        Dim objPin As MapPoint.Pushpin
        Set objPin = oMap.AddPushpin(objLocTst, "Name" & CStr(I))
        'Make sure the balloon is closed.
        objPin.BalloonState = geoDisplayNone
        'Put additional data in the note field of the pin.
        Dim strNote As String
        strNote = "This is some" & vbCrLf & "text for the" & vbCrLf &
"note part"
        objPin.Note = strNote

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

Private Sub Form_Load()
   ' Try to attach to running instance of MapPoint
   On Error Resume Next
   Set oMpApp = GetObject(, "MapPoint.Application")
   On Error GoTo 0

   If oMpApp Is Nothing Then
      ' Attaching failed - try creating an object
      On Error Resume Next
      Set oMpApp = CreateObject("MapPoint.Application")
      On Error GoTo 0

      If oMpApp Is Nothing Then
         MsgBox "Could not create MapPoint object"
         End
      End If
      ' make the app visible
      oMpApp.Visible = True
   End If

   ' Ensure MapPoint survives when app terminates
   oMpApp.UserControl = True

   ' Retrieve the active map
   Set oMap = oMpApp.ActiveMap
End Sub

The problem is, with this version I cannot reproduce the problem. Are
you sure the error message you get doesn't have to do with your data
access ?

   Regards,
   Gilles [MVP].

   (Please reply to the group, not via email)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Akhtar Hussain  
View profile  
 More options Mar 13 2003, 5:08 am
Newsgroups: microsoft.public.mappoint
From: "Akhtar Hussain" <akhtar.huss...@fmg.co.uk>
Date: Thu, 13 Mar 2003 10:08:34 -0000
Local: Thurs, Mar 13 2003 5:08 am
Subject: Re: AddPushpin Error 4013
Giles,

I appreciate your answer and I tried the code. It works but the problem I
seem to be having is that it works
using the mappoint  application  object but it seems to fail if I use the
Active X control.

I don't think it is the data access that is wrong.

Thanks for your help.

"Akhtar Hussain" <akhtar.huss...@fmg.co.uk> wrote in message

news:02cc01c2e89d$2bc18ed0$2f01280a@phx.gbl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gilles Kohl [MVP]  
View profile  
 More options Mar 13 2003, 12:37 pm
Newsgroups: microsoft.public.mappoint
From: "Gilles Kohl [MVP]" <gilles@_deletethisincludingunderlines_compuserve.com>
Date: Thu, 13 Mar 2003 18:33:50 +0100
Local: Thurs, Mar 13 2003 12:33 pm
Subject: Re: AddPushpin Error 4013

>I appreciate your answer and I tried the code. It works but the problem I
>seem to be having is that it works
>using the mappoint  application  object but it seems to fail if I use the
>Active X control.

Here's a (somewhat streamlined) version using the ActiveX control:

Option Explicit
Dim oMap As MapPointCtl.Map
Dim objDs As MapPointCtl.DataSet

Private Sub Command1_Click()
   Dim I As Integer

   For I = -89 To 89
      Dim objLocTst As MapPointCtl.Location
      Set objLocTst = oMap.GetLocation(I, 2 * I, 0)

      Dim objPin As MapPointCtl.Pushpin
      Set objPin = oMap.AddPushpin(objLocTst, "Name" & CStr(I))
      objPin.BalloonState = geoDisplayNone
      objPin.Note = "Some text" & vbCrLf & "for the note"

      objPin.MoveTo objDs
   Next I
End Sub

Private Sub Form_Load()
   MappointControl1.NewMap 1
   Set oMap = MappointControl1.ActiveMap
   Set objDs = oMap.DataSets.AddPushpinSet("Suppliers")
End Sub

   Regards,
   Gilles [MVP].

   (Please reply to the group, not via email)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Akhtar Hussain  
View profile  
 More options Mar 14 2003, 12:55 pm
Newsgroups: microsoft.public.mappoint
From: "Akhtar Hussain" <akhtar.huss...@fmg.co.uk>
Date: Fri, 14 Mar 2003 17:53:25 -0000
Local: Fri, Mar 14 2003 12:53 pm
Subject: Re: AddPushpin Error 4013
Giles,

That worked !

In my map I was opening a map and not setting the map to the control.

You've been a great help and have saved me a lot of head scratching.

Thanks for all your help.

Akhtar

"Akhtar Hussain" <akhtar.huss...@fmg.co.uk> wrote in message

news:02cc01c2e89d$2bc18ed0$2f01280a@phx.gbl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gilles Kohl [MVP]  
View profile  
 More options Mar 14 2003, 4:57 pm
Newsgroups: microsoft.public.mappoint
From: "Gilles Kohl [MVP]" <gilles@_deletethisincludingunderlines_compuserve.com>
Date: Fri, 14 Mar 2003 22:54:16 +0100
Local: Fri, Mar 14 2003 4:54 pm
Subject: Re: AddPushpin Error 4013
Akhtar,

On Fri, 14 Mar 2003 17:53:25 -0000, "Akhtar Hussain"

<akhtar.huss...@fmg.co.uk> wrote:
>Giles,

>That worked !

>In my map I was opening a map and not setting the map to the control.

>You've been a great help and have saved me a lot of head scratching.

>Thanks for all your help.

You're welcome - glad to hear you were able to find the problem !

   Regards,
   Gilles [MVP].

   (Please reply to the group, not via email)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »