I am importing lat/lon data from a comma separted file into a VB app using
the MapPoint ActiveX control. I need to iterate through all the imported
data points (... may be several hundred) in the order that they are in the
source file. However using the ImportData function to import the data into a
dataset then iterating through the recordset does not retain the original
sequence of data points in the source file.
Any idea what causes this, or ways to get around it are appreciated. The
LinkData function behaves the same, even using a sequnce number field as the
primary key.
A code snippet follows (the code simply puts the sequence number of the
record in the source file, which is one of the fields, into a listbox called
List1). Although the following code uses the ShowImportWizard, I have tried
various different versions using ImportData and LinkData functions with the
same result.
Dim objDS As MapPointCtl.DataSet
Dim objRS As MapPointCtl.Recordset
With MPControl.ActiveMap.DataSets
Set objDS = .ShowImportWizard
End With
Set objRS = objDS.QueryAllRecords
objRS.MoveFirst
List1.Clear
Do
List1.AddItem objRS.Fields(1).Value
objRS.MoveNext
Loop Until objRS.EOF
-- Harv Hundal