Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MSFlexGrid and encapsulated RDO

Posted on 2001-06-26
3
Medium Priority
?
319 Views
Last Modified: 2013-11-25
To display a predefined set of columns from an SQL Server 7.0 table I am a MSFlexGrid control using a class module encapsulating an RDO resultset. I populate the resultset using a stored procedure, and expose the individual RDOResultset::RDOColumns in read-only String properties,  the RDOResultset::EOF property in a public Boolean property.

I use the following routine to populate the grid:

Dim Y As Long
Dim X As Integer
Dim Deleted As Boolean

Grid.Rows = Grid.FixedRows
Y = Grid.Rows
'XInquiry is set to one of 5 instances of Cinquiry
With XInquiry    
    Do Until .ciEOF = True
        If blnInterrupt = True Then
            Exit Sub
        End If
        Grid.Rows = Y + 1
        Grid.Row = Y
        Grid.TextMatrix(Y, 0) = .ciResultDeleted
        Select Case Trim(Grid.TextMatrix(Y, 0))
            Case "A"
                Deleted = False
            Case "T"
                Deleted = True
            Case "N"
                Deleted = False
            Case "Y"
                Deleted = True
        End Select
        If Deleted = True Then
            For X = 0 To (Grid.Cols - 1)
                Grid.Col = X
                Grid.CellBackColor = vbCyan
            Next X
        End If
        Grid.TextMatrix(Y, 1) = CStr(.ciResultType)
        Grid.TextMatrix(Y, 2) = .ciResultUID
        Grid.TextMatrix(Y, 3) = .ciResultName
        If .ciResultPropLocNumber = 0 Then
            Grid.TextMatrix(Y, 4) = .ciResultPropLocName
        Else
            Grid.TextMatrix(Y, 4) = CStr & _(.ciResultPropLocNumber) & " " & .ciResultPropLocName
        End If
        Y = Y + 1
        .ciMoveNext
        DoEvents
    Loop
    .ciFlushResultset 'deallocate the RDO resultset
End With

While using small resultsets (1-500 rows), this code performs well, but I typically handle resultsets of 2500-15000 rows, and would like to make the MSFlexGrid populate faster, as my debugging traces have led me to the conclusion that the MSFlexGrid population code is the bottleneck.
0
Comment
Question by:VBDemiurge
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 600 total points
ID: 6227646
One way to make things quicker is to set the MSFlexgrid.Redraw property to false at the beginning and then True at the end. This has the effect of disabling the update of the grid for each individual change, where you are setting cell colours, this may make a dramatic increase in the rate at which the grid is populated.
0
 

Author Comment

by:VBDemiurge
ID: 6228905
Thanks for the suggestion, TimCoffee. I'll try that now.
0
 

Author Comment

by:VBDemiurge
ID: 6229025
TimCoffee:

Working the MSFlexGrid::Redraw property reduced the load time for 15000 rows from 75-90 seconds to 30-45 seconds. My goal is to reduce the load time to a maximum of 20 seconds for 15000 rows.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question