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 2 of 2

problems with queryshape

This is a discussion on problems with queryshape within the MapPoint Desktop Discussion forums, part of the Map Forums category; Trying to return all pushpins in a shape with 3 datasets on map. As i iterate through the shapes I ...

  1. #1
    chas is offline Junior Member White Belt
    Join Date
    Aug 2006
    Posts
    8

    problems with queryshape

    Trying to return all pushpins in a shape with 3 datasets on map. As i iterate through the shapes I get the same count of "3" regardless of how many pushpins are in shape . . . what am i doing wrong?

    Code:
         tshapes = objmap.Shapes.Count
            Do While tshapes <> 0
                Set objshape = objmap.Shapes.Item(tshapes)
                objshape.Select
                Set objrec = objdata.QueryShape(objshape)
                  MsgBox Str(objdata.RecordCount)
                objrec.MoveFirst
                reccount = 1
                Do While Not objrec.EOF
                    reccount = reccount + 1
                Loop
                msgbox reccount
                tshapes = tshapes - 1
            Loop
    Last edited by Wilfried; 09-08-2006 at 02:46 PM.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    The first messagebox will popup (with the record count I assume), but then your code runs forever in the second loop because you dont increment the cursor in the recordset. You have to call MoveNext in the second loop. Or there is no record and the result is already EOF.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VB6 error "Method 'QueryShape' of object 'DataSet' fail
    By David J in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-07-2005, 02:13 PM
  2. QueryShape dont work as expected
    By Bed007 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-23-2005, 03:39 PM
  3. Problem with dataset.QueryShape Method
    By Ray Liu in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-15-2004, 11:55 AM
  4. Huge memory leak in using QueryShape?
    By random0000 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-28-2003, 06:22 AM
  5. QueryShape problem Please help
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-13-2003, 09:57 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