MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




using ImportData with VBScript

This is a discussion on using ImportData with VBScript within the Development forums, part of the MapPoint 2006/2009 Discussion category; I have problems using ImportData. Somehow the call of ImportData fails Please help! Dim oMP, oDSSMP, oDSMP Set oMP = ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-17-2007
Junior Member
White Belt
 
Join Date: Dec 2007
Location: Germany
Posts: 9
Unhappy using ImportData with VBScript

I have problems using ImportData. Somehow the call of ImportData fails
Please help!

Dim oMP, oDSSMP, oDSMP
Set oMP = GetObject(, "MapPoint.Application")
Set oDSSMP = oMP.ActiveMap.DataSets

' geoFieldName = 1
' geoFieldName2 = 2
' geoFieldAddress1 = 3
' geoFieldCity = 6
' geoFieldPostal1 = 11
' geoFieldCountry = 15
' geoFieldInformation 22
' geoFieldData 23
Dim myExampleArray(3, 2)
myExampleArray(1, 1) = "Name"
myExampleArray(1, 2) = 1 'geoFieldName

myExampleArray(2, 1) = "Vorname"
myExampleArray(2, 2) = 2 'geoFieldName2

myExampleArray(3, 1) = "Land"
myExampleArray(3, 2) = 15 'geoFieldCountry


Set oDSMP = oDSSMP.ImportData("C:\Temp\export.txt", myExampleArray, , 9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 12-29-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
Re: using ImportData with VBScript

Hi,

What exacly fails, what is the error, is there an exception raised ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-25-2008
Junior Member
White Belt
 
Join Date: Dec 2007
Location: Germany
Posts: 9
Re: using ImportData with VBScript

The Code is:

800A0FC6

"Data could not be imported, columns not found" (translated from german message)

Set oDSMP = oDSSMP.ImportData(sMyFile, myExampleArray, 39070, 9, 1)

Last Parameter means geoImportFirstRowNotHeadings
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-25-2008
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 848
Blog Entries: 7
Re: using ImportData with VBScript

But the first row consists of column headings, doesn't it?

(and if it doesn't, how are you telling it what each column is?)

Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 01-25-2008
Junior Member
White Belt
 
Join Date: Dec 2007
Location: Germany
Posts: 9
Re: using ImportData with VBScript

Quote:
Originally Posted by Winwaed View Post
But the first row consists of column headings, doesn't it?

(and if it doesn't, how are you telling it what each column is?)

Richard
No -> i use the array to tell him what columns exist in that file.

Regards

Pit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 01-25-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,382
Blog Entries: 1
Re: using ImportData with VBScript

Can you post a sample of the export.txt text file as an attachment?

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 01-28-2008
Junior Member
White Belt
 
Join Date: Dec 2007
Location: Germany
Posts: 9
Re: using ImportData with VBScript

Dim myExampleArray(6, 1)

myExampleArray(1, 1) = 1 'geoFieldName

myExampleArray(2, 1) = 2 'geoFieldName2

myExampleArray(3, 1) = 15 'geoFieldCountry

myExampleArray(4, 1) = 6 'geoFieldCity

myExampleArray(5, 1) = 3 'geoFieldAddress1

myExampleArray(6, 1) = 11 'geoFieldPostal1

Set oDSMP = oDSSMP.ImportData(sMyFile, myExampleArray, 39070, 9, 1)
Attached Files
File Type: txt export_noheader.txt (90 Bytes, 1 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 01-28-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,382
Blog Entries: 1
Re: using ImportData with VBScript

Are you able to import it using the regular MapPoint interface / wizard?

I've never imported fixed width text, only CSV or comma-separated.

Can you convert to CSV and see if that helps it to work?

By the way, this is my 2,000th post!

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~

Last edited by Eric Frost; 01-28-2008 at 08:35 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 01-29-2008
Junior Member
White Belt
 
Join Date: Dec 2007
Location: Germany
Posts: 9
Re: using ImportData with VBScript

Hi Eric!

Thank you for your help!!

Yes i can import the file directy using the wizard.
The columns are not fixed, they are separated by TABs

Pit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 01-29-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,382
Blog Entries: 1
Re: using ImportData with VBScript

Just want to be sure - it is working for you now?

What did you do? Switch to CSV?

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
importdata, vbscript


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
ImportData lacja MapPoint 2006/2009 Discussion 6 11-19-2006 09:57 AM
MapPoint 2002 with ASP (vbscript) eatech MapPoint 2006/2009 Discussion 6 05-05-2005 04:12 AM
ImportData Anonymous MapPoint 2006/2009 Discussion 0 11-04-2004 03:05 AM
Will Pay $$$ for Assistance - ASP / VBSCRIPT webdbx MapPoint 2006/2009 Discussion 1 07-09-2004 08:31 PM
Clientside VBScript and MapPoint? Anonymous MapPoint 2006/2009 Discussion 4 03-14-2004 05:34 PM


All times are GMT -5. The time now is 01:11 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Ski Resort
Pick a destination. Pick a ski resort. Pick up your skis. Pick up your poles. Holiday Hypermarket makes it simple and fast to find a ski resort for you.

Portugal Weather
Check out Portugal Weather - Travel Counsellors details information on Portugal including, weather, flights and accommodation.

Jamaica Holiday
Fancy a Jamaica Holiday? Then visit dealchecker.co.uk and find out what the big deal is. Book a bargain when you book online.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Tunisia
Tunisia enjoys excellent weather, golden beaches and a beautiful blue sea. Moving away from the beach you will find a country that has a rich and varied past. Discover the secrets of history yourself by exploring all the ruins.

Travel Deals
Click here and read up on the travel deals available online.

Portugal Holidays
We specialise in Portugal holidays. Visit our On The Beach website for more information.


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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52