View Full Version : ImportData method doesn't function

12-26-2002, 07:29 AM
I use Mappoint within VB.
I try to import a text file with the metod ImportData, but I get an error saying: "Enable to connect to the DataSourceMoniker specified"
My call is:
Set oDS = oMap.DataSets.importData(filename, , geoCountryDefault, geoDelimiterDefault, 0)

My text file is an ordinary text file with tabulation like separator.

Could you help me please ?


John Meyer
12-27-2002, 10:40 AM

If your file has a TAB delimiter you two choices. If you specify geoDelimiterDefault then your filename has to have an ".asc" extention.

Or insted of geoDelimiterDefault use geoDelimiterTab.

Also, the last parameter is ImportFlags which you have a 0. That would mean the first row of the file contains field names, which is the default. If that is not the case, change it to 1.

12-01-2003, 06:31 AM
I am importing a tab delimited file that has a ".GPS" extension. I have tried geoDelimiterTab and geoDelimiterDefault but the import still fails "Cannot connect with the specified DataSourceMoniker."
Changing the name of the file to have a ".TXT" extension allows the import to succeed. Unfortunately, the naming convention is out of my hands and I do not want to make a copy of the file.
Are there any other options?


John Meyer
12-01-2003, 09:27 AM
Creating a temp file from the .gps file might be the way to go? I don't see anything that says it must be named .txt but you kinda proved it?