PDA

View Full Version : I am interfacing Mappoint with VB. I am plotting ....



Anonymous
06-10-2002, 02:58 PM
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?

Anonymous
06-10-2002, 02:58 PM
Thanks for your help.

Walt Cygan
06-10-2002, 02:58 PM
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 (http://www.mp2kmag.com/author.asp?id=9)