Maximum number of records in MSHFlexgrid

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?
whiwexAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chrismanncalgavinCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jagadeesh_motamarriCommented:
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
csachdevaCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.