PDA

View Full Version : Matching unmatched items after import into VB6 app



abaker
12-19-2002, 06:47 AM
I am importing a salesman's route (in a CSV file) into my VB6 app using the Mappoint ActiveX control. The CSV file contains street, town, county and postcode, and I am using the ImportData method to create a dataset and associated pushpins on my map, first of all using the postcode. However, some postcodes in the data may be missing or incorrect, and the ImportData method does not find the correct location or add a pushpin to the map. Using a Mappoint recordset, I can find which items were unmatched, and then find them using the other criteria (street, town etc), with the FindAddressResults method. If the correct location can be found in this way, I would like to add the result to the dataset, but cannot find a way of doing this. Any help would be appreciated.
Thanks in advance.
Andy Baker

Anonymous
12-19-2002, 08:01 AM
Hi,
I try to give you a way:

mymap.NewMap (geoMapEurope)
Set oMap = mymap.ActiveMap

'You add a group to the collection Datasets
oMap.DataSets.AddPushpinSet "g1" 'this is a group

'You find your adress
Set locTest = oMap.FindAddressResults("", txt, "", "", vcode, vcountry).Item(1)

'You place your pushpin in your map
Set opPin = oMap.AddPushpin(locTest, title)
'You had your pushpin to the group
opPin.MoveTo oMap.DataSets.Item("g1")
'The pushpin will have a symbol ...
opPin.BalloonState = geoDisplayName
opPin.Symbol = n

I think that the grpou "g1" coul be those you have import from your data file.

Bye,

Val

abaker
12-20-2002, 05:27 AM
Thanks for the tip. Setting the pushpin symbol and adding it manually to the map is much better than not displaying it at all. The problem that I now have is that the pushpin remains unmatched. I am displaying the details of each location using
xShowFields = Array(oDataset.Fields(2), oDataset.Fields(3), oDataset.Fields(4), oDataset.Fields(5))
oDataset.SetFieldsVisibleInBalloon (xShowFields)

to display the customer fields in the information balloon. However, the unmatched pushpin has no such fields, and I can only display the pushpin name, which is the unique customer code. This is not very meaningful, unless the user knows all the codes, and I would prefer to be able to display the customer name and address as I do for all the imported pushpins.

Anonymous
01-20-2004, 07:39 AM
I am trying to link Access and Mappoint so that I can check to see which records contain invalid postcodes.
Is this possible using VBA as I do not have access to VB6 or other SDKs?

I don't need any automation, I just want it to return a list of al records (account code & post code), so that I can then go to those accounts and correct/update the post codes