?
Solved

Maximum number of records in MSHFlexgrid

Posted on 2006-04-13
5
Medium Priority
?
1,309 Views
Last Modified: 2008-01-09
Is there a maximum nuber of lines that a flxgrid can contain? I'm queying a Access database that could return several thousand records. I want to put them in a flexgrid. Will a flegrid allow this many records?

Also What is the maximum number of records that can be in ADODC recordset?
0
Comment
Question by:whiwex
3 Comments
 
LVL 8

Accepted Solution

by:
chrismanncalgavin earned 672 total points
ID: 16446265
Hi whiwex,

As far as I can see, there is no maximum for a MSHFlexgrid as it is determined by the memory available on your computer. The standard Flexgrid does have a maximum of 350,000 however.
http://support.microsoft.com/default.aspx?scid=kb;en-us;191006&Product=vbb

Regarding the ADODC recordset, I also believe there is no maximum, the maximum is determined by the type of database you are using which probably has a limit to the amount of records in a table (very high though, and mainly determined by memory and hard disk space).

-Chris-
0
 
LVL 10

Assisted Solution

by:jagadeesh_motamarri
jagadeesh_motamarri earned 664 total points
ID: 16452299
Hi Whiwex,

The Hierarchical FlexGrid control always displays a maximum of 2048 rows regardless of the number of records in the data source.


Although the record-count of the mshflexgrid is correct, only the first 2048 records are displayed. If you need to display more than 2048, you need to open the recordset and populate the grid using the GetString method of ADO and the Clip property of the MSHFlexGrid.


Click on the link below to work on this area....
http://support.microsoft.com/default.aspx?scid=kb;en-us;194653



cheers
0
 
LVL 4

Assisted Solution

by:csachdeva
csachdeva earned 664 total points
ID: 16524646
The Hierarchical FlexGrid control always displays a maximum of 2048 rows regardless of the number of records in the data source. The maximum number of rows and columns in MSHFlexGrid is limited by the memory available on your computer.

Although the record-count of the mshflexgrid is correct, only the first 2048 records are displayed. If you need to display more than 2048, you need to open the recordset and populate the grid using the GetString method of ADO and the Clip property of the MSHFlexGrid.

The code below can be used in place of the code in the Command1_Click event in the MORE INFORMATION section to work around this behavior:    Dim cn As New ADODB.Connection
   Dim rs As New ADODB.Recordset
   Dim rsVar As Variant
   Dim i As Integer
   cn.Open "Testing"  '<-- Your DSN

   rs.Open "select * from Cies", cn, adOpenStatic, adLockOptimistic
   rs.MoveLast

   rs.MoveFirst
   ' Assuming that rs is your ADO recordset
   MSHFlexGrid1.Rows = rs.RecordCount + 1

   rsVar = rs.GetString(adClipString, rs.RecordCount)

   MSHFlexGrid1.Cols = rs.Fields.Count

   ' Set column names in the grid
   For i = 0 To rs.Fields.Count - 1

       MSHFlexGrid1.TextMatrix(0, i) = rs.Fields(i).Name

   Next

   MSHFlexGrid1.Row = 1
   MSHFlexGrid1.Col = 0

   ' Set range of cells in the grid
   MSHFlexGrid1.RowSel = MSHFlexGrid1.Rows - 1
   MSHFlexGrid1.ColSel = MSHFlexGrid1.Cols - 1
   MSHFlexGrid1.Clip = rsVar

   ' Reset the grid's selected range of cells
   MSHFlexGrid1.RowSel = MSHFlexGrid1.Row
   MSHFlexGrid1.ColSel = MSHFlexGrid1.Col

   rs.Close
   Set rs = Nothing
   cn.Close
   Set cn = Nothing

Regards,
Chetan Sachdeva
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is about my first experience with programming Arduino.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Introduction to Processes

862 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