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

ImportData

This is a discussion on ImportData within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm trying to importdata from an Access Table. It works fine if I import every records. But, before importing data, ...

  1. #1
    lacja is offline Member Yellow Belt
    Join Date
    Aug 2006
    Posts
    47

    ImportData

    I'm trying to importdata from an Access Table.

    It works fine if I import every records.

    But, before importing data, user has to enter few parameters (date, time, ...)

    I'd like to import only records that fits in user's parameters

    I've tried with a select in the database, put records into a text file and then importdata with geoDelimiterSemicolon (Set oDS = objMap.DataSets.ImportData(myfilename, , geoCountryCanada, geoDelimiterSemicolon, 1)).

    My oDS dataset is always empty.

    What's wrong?

    Thanks

  2. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: ImportData

    Lacja,

    Did you solve this problem or are you still seeking help?
    Are you sure you're exporting using semicolon and not comma?
    Can you post a few lines of the text file?

  3. #3
    lacja is offline Member Yellow Belt
    Join Date
    Aug 2006
    Posts
    47

    Re: ImportData

    Here it is:

    47,6443507242948000 ; -70,1569795701653000
    46,8069542571902000 ; -71,2153752241284000
    46,8412129394710000 ; -71,2770252116024000
    46,8361057620496000 ; -71,2258935067803000
    48,5575715638697000 ; -71,6472415532917000
    46,8123630993068000 ; -71,2303665094078000
    48,4017124213278000 ; -71,1607911810279000

  4. #4
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: ImportData

    OK. You need an array in the last parameter that indicates
    that the first field is geoFieldLatitude and the second geoFieldLongitude.
    You need only look up those words for an example.

  5. #5
    lacja is offline Member Yellow Belt
    Join Date
    Aug 2006
    Posts
    47

    Re: ImportData

    Hi,

    I've alreayd tried:

    Dim myfilename As String
    Dim myExampleArray(2, 2)

    myExampleArray(1, 1) = "Lat"
    myExampleArray(1, 2) = geoFieldLatitude
    myExampleArray(2, 1) = "Lon"
    myExampleArray(2, 2) = geoFieldLongitude

    myfilename = "c:\impdata.txt"
    ...
    Set oDS = objMap.DataSets.ImportData(myfilename, myExampleArray, geoCountryCanada, geoDelimiterSemicolon, 1)

    oDS always return "nothing"

  6. #6
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: ImportData

    You'd have to make some concessions, but this works for me

    Public Function ImportText()
    Dim myfilename As String
    Dim myExampleArray(1, 1)

    myExampleArray(0, 0) = "Latitude"
    myExampleArray(0, 1) = geoFieldLatitude
    myExampleArray(1, 0) = "Longitude"
    myExampleArray(1, 1) = geoFieldLongitude

    myfilename = "C:\import.txt"
    oMap.DataSets.ImportData myfilename, myExampleArray, , geoDelimiterSemicolon, 0

    End Function

    Latitude;Longitude
    47.6443507242948000 ; -70.1569795701653000
    46.8069542571902000 ; -71.2153752241284000
    46.8412129394710000 ; -71.2770252116024000
    46.8361057620496000 ; -71.2258935067803000
    48.5575715638697000 ; -71.6472415532917000
    46.8123630993068000 ; -71.2303665094078000
    48.4017124213278000 ; -71.1607911810279000

  7. #7
    lacja is offline Member Yellow Belt
    Join Date
    Aug 2006
    Posts
    47

    Re: ImportData

    Hey!

    Now it works fine.

    It was just my array definition?

    Great

    Thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. importdata to shaded areas
    By max677 in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 10-14-2006, 04:08 PM
  2. ImportData method ?
    By mgorgone in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-02-2005, 02:31 PM
  3. c# ImportData method help needed
    By fletch in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 03-09-2005, 10:15 AM
  4. ImportData
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-04-2004, 04:05 AM
  5. Implementing ImportData in C/C++
    By moojit in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-01-2002, 11:58 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