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

FindAddressResults returns nothing

This is a discussion on FindAddressResults returns nothing within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, I have a problem with the function FindAddressResults in VB. I try to do this : Code: Dim findres ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    FindAddressResults returns nothing

    Hello,

    I have a problem with the function FindAddressResults in VB.

    I try to do this :

    Code:
    Dim findres As FindResults
    Dim mapobj As MapPoint.Map
    Set findres = mapobj.FindAddressResults(, , , , , geoCountryx)
    and I have this result :

    Code:
    findres.count = 0
    What's the problem? How can I do to locate a pushpin in the centro´d of the country I choose?
    Maybe it's a MapPoint problem?

    Thanks in advance

    mpGuest

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Hi,

    I think this is a little too mutch asking from MapPoint finding center of countries does not work as also not center of earth or universe

    I think in practice most people know more or less whar earth is (or their country), so the search has to be a bid more detail

    rgds, Wilfried
    http://www.mestdagh.biz

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Hello,

    Thanks for your response...
    My question was not very explicit, so I give some explanations :
    In MapPoint application, I have some records that the application localize correctly, finding result by country. So the pushpin is in the middle of the country.
    I try to do this with VB. I have 2 methods :
    - I use the function queryAllRecords to have a dataset. Then I study each record with the function IsMatching and CallMatchMethod
    --> It returns a result and the pushpin is located in the middle of the country
    - I use the function FindAddressResults (cf. previous post) and the result is findresult.count = 0
    --> No result found
    Example of the record
    fields : name,address,city,postal,country
    record : myname , , , , geoCountryUkraine

    So I want to know :
    - Is there a problem in my method?
    - Is there a problem with FindAddressResult method?
    - How can I do to have all records localized (MapPoint application do that, so is ther a problem in VB?)?

    Thanks a lot for responses

    mpGuest

  4. #4
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    You may want to post the function that is not working so we can have a look. Make your example as complete as possible then maybe someone can see what the problem is.

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Hi,

    FindAddressResults dont give a result if there is no match.

    But I dont understeand exacly what you try. Probably because my native language is not English spoken Like John already mentioned, with a piece of code it can mabe cleared out better.

    rgds, Wilfried
    http://www.mestdagh.biz

  6. #6
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Thanks for your responses.
    I'll try to explain my problem but it's not very easy, english is not my native language

    I want to localize some data, which contains address, city, region, postal1 and country. But some fields can be empty so I have to do some tests.

    Some examples of data :
    fields : name - address - city - region - postal1 - country
    name1 - rue du lac - - - - france
    name2 - - - - - ukraine

    I have an excel file, I create a recordset and I read I line by line :

    Code:
    Dim findres As FindResults
    Set findres = mapobj.FindAddressResults(address, city, , region, postal1, country)
    If addr1 <> "" And isResultCorrect&#40;findres&#41; <> 0 Then  'function isResultCorrect search the findres.count and item
        ' OK &#58; address
        Set pushp = m_mapobj.AddPushpin&#40;findres.Item&#40;1&#41;, name&#41;
        pushp.Note = name
        pushp.MoveTo dataset
        matchmeth = geoByStreetAddress
        pushp.Symbol = 30
    Else ' NOK by address --> search again &#58; city
        Set findres = m_mapobj.FindAddressResults&#40;, city, , region, , country&#41;
        If isResultCorrect&#40;findres, dept, country&#41; <> 0 Then
            ' OK &#58; city without postal1
            Set pushp = m_mapobj.AddPushpin&#40;findres.Item&#40;isResultCorrect&#40;findres, dept, country&#41;&#41;, name&#41;
            pushp.Note = name
            pushp.MoveTo m_dataset
            matchmeth = geoByCity
            pushp.Symbol = 28
        Else ' NOK by city --> search again &#58; postal1
            Set findres = m_mapobj.FindAddressResults&#40;, , , region, postal1, country&#41;
            If isResultCorrect&#40;findres, dept, m_country&#41; <> 0 Then
                ' OK &#58; postal1
                Set pushp = m_mapobj.AddPushpin&#40;findres.Item&#40;1&#41;, name&#41;
                pushp.Note = name
                pushp.MoveTo m_dataset
                pushp.Symbol = 29
                matchmeth = geoByPostal1
            Else ' NOK by postal1 --> search again &#58; country
                Set findres = m_mapobj.FindAddressResults&#40;, , , , , country&#41;
                If isResultCorrect&#40;findres&#41; <> 0 Then
                    ' OK &#58; country
                    Set pushp = m_mapobj.AddPushpin&#40;findres.Item&#40;1&#41;, name&#41;
                    pushp.Note = name
                    pushp.MoveTo m_dataset
                    pushp.Symbol = 29
                    matchmeth = geoByCountry
                Else
                    matchmeth = -1
                    Debug.Assert 0
                End If
            End If
        End If
    End If
    There is a problem whith the 2 records in example.
    MapPoint localize them byCountry (at the centro´d of france and ukraine).
    But the function FindAddressResults in VB can't localize then by country, so I can see them in the map.

    And when I use the property MatchingMethod and the CallMatchMethod, the record is localized by country.

    So is there a problem with the function FindAddressResults? Or in the vb code I use?

    Thanks a lot for your responses, I don't know how to resolve my problem.

    mpGuest

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is MapPoint or something else best to map election returns?
    By jhbroussard in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-24-2005, 08:44 AM
  2. How to get the Best Matched Address from FindAddressResults.
    By gvkreddy in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 01-10-2005, 06:05 AM
  3. Problem with FindAddressResults
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-01-2004, 10:04 AM
  4. FindAddressResults not always working?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-10-2003, 06:25 AM
  5. Need help about the FindAddressResults
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-21-2002, 08:51 PM

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 26 27 28 29 30 31 32 33 34 35 36