Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Poor performance when getting data from MapPoint Recordset within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I am trying to get Data from a MapPoint Recordset and insert them into a Listview control using a ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Poor performance when getting data from MapPoint Recordset I am trying to get Data from a MapPoint Recordset and insert them into a Listview control using a MoveNext loop but it is taking ages to finish (with only 157 records)! The performance is really poor... Is there any better way to get Data from a Recordset object improving performance? Please tell me there is... tia Nikos Code: Public Sub refreshListView(oRS As MapPoint.Recordset)
On Error GoTo Errhandler:
Dim oItem As MSComctlLib.ListItem
Dim oFields As MapPoint.Fields
Dim i As Integer
Dim tempValue As String
Set oFields = oRS.Fields
lstDataGrid.ColumnHeaders.Clear
i = 1
For i = 1 To oRS.Fields.Count
lstDataGrid.ColumnHeaders.Add , , oFields(i).Name
Next
oRS.MoveFirst
Do While Not oRS.EOF
Set oFields = oRS.Fields
i = 0
For i = 0 To oFields.Count - 1
tempValue = Switch(IsNull(oFields(i + 1).Value), "", Not IsNull(oFields(i + 1).Value), oFields(i + 1).Value)
If i = 0 Then
Set oItem = lstDataGrid.ListItems.Add(1, , tempValue)
Else
oItem.SubItems(i) = tempValue
End If
If oFields(i + 1).IsPrimaryKey = True Then oItem.Tag = tempValue
Next
Debug.Print oFields(1)
oRS.MoveNext
Loop
Set oItem = Nothing
Set oFields = Nothing
Exit Sub
Errhandler:
Set oItem = Nothing
Debug.Print Err.Description
Set oFields = Nothing
End Sub
|
![]() |
| Tags |
| data, mappoint, performance, poor, recordset |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint: Installation & Performance | Transit | MapPoint 2006/2009 Discussion | 0 | 06-13-2005 03:10 AM |
| Mappoint ActiveX performance | Anonymous | MapPoint 2006/2009 Discussion | 2 | 09-09-2003 05:13 PM |
| MapPoint Add-In performance | rseman | MapPoint 2006/2009 Discussion | 2 | 05-06-2003 08:00 AM |
| Recordset prevents link data | sweenea | MapPoint 2006/2009 Discussion | 0 | 03-03-2003 03:34 PM |
| Deriving a recordset from a mappoint recordset | RichardHayes | MapPoint 2006/2009 Discussion | 0 | 09-06-2002 02:44 AM |
Hurghada Holiday
Enjoy sunny Egypt when you book a Hurghada holiday through UlookUbook at a good price!