Top |
Post New Question |
Read All |
MP2K Asks Microsoft
714
Philip
-
June 10, 2002
I am interfacing Mappoint with VB. I am plotting various points from a database. I want to be able to delete various pushpins. The problem is that some of the pushpins had the same name(i.e. same company name, just different locations) and when I go to delete them, the program crashes because there are two with the same name. Does anyone have an idea on how to correct this without having to go through the entire database and change the names?
Answers:
June 10, 2002
If you are plotting them individually, you could check to see if a name already exists before adding a new pushpin by using the FindPushpin method. If the name is already in use, add a tiebreaker number to the name and see if that exists. If not, add the pushpin. Otherwise repeat the tiebreaker process until you find a name that hasn't been used.
Of course, you could also add a unique counter field in your database (Identity column in SQL Server) and use it as part of your name like "Microsoft (1546)" where 1546 is the value of the counter column. That would ensure uniqueness.
- Walt Cygan
June 11, 2002
Thanks for your help.
Post New Answer / Follow-up