Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 581
  • Last Modified:

Flexgrid Large Dataset Problem

Hi all,

I am currently making a VB6 application to display data from a database. Unfortunately sometimes the users need to see 6000 - 9000 records in one go in a MSHFlexgrid. The amount of time it takes to open this window can be around 10 seconds, although the query itself is not the problem. I really need to use the MSHFlexgrid as other code has been developed around for it.

I have looked around on the web and tried only displaying records that would be visible to the user (with the flexgrids RowIsVisible and TopRow properties) but with no success. Can anyone offer any help with this?

I am currently using the .DataSource = recRecords method.

Thanks for any help.
1 Solution
Would it be practical to have users page through the data?
freddieheinekenAuthor Commented:
Thanks Fuisseran,

Currently users can sort columns by clicking on column headers, and also search for keywords in the whole recordset. So long as these functions remain paging would be great! How would i go about this?
Once you have you RecordSet set these properties
RecordSet.PageSize 'how many records to show on each page
RecordSet.AbsolutePage 'the current page the user is on

Then you have to fill your grid with a loop instead of assigning it to teh datasource

Dim i As Integer
i = RecordSet.AbsolutePage
Do While RecortSet.AbsolutePage = i And Not RecordSet.EOF
'put code here to fill the grid

As long as you perform all actions on the RecordSet your search and stuff should.  Still unsure as to why you would want to display 9000 records all at once but this might help.  The prinicple here is somethign similar to an internet search page where you can page thorugh the results of your search hope this helps.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

freddieheinekenAuthor Commented:
well i have messed around with this for a while, trying to load a page in and then have the code load more data when the flexgrid was scrolled, and leaving filters, search function etc., but it caused more problems than it solved. I have gone back to the .DataSource = rs method.
I needed a flexgrid simply to show a list of all records in a table (name, address etc.) where there was no obvious filter. It is strange that in Access running the query brings and fills up the grid almost instantly.
freddieheinekenAuthor Commented:
ok after trying lots of different methods i have resorted to a datagrid that fills within a second compared to 7-8 seconds with a mshflexgrid. i will need to redo sorting, querying etc. but i really needed to make it as fast as the DOS system I was replacing! incidently that brought up the same number of records in 1 second and allowed autocomplete searches....

for anyone looking for more info on this i found the following link:


thanks anyway fuisseran.

Hi freddieheineken,
This old question (QID 20559903) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
question PAQ'ed and points refunded

CS Moderator

Featured Post


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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now