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

x
  • 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.
0
freddieheineken
Asked:
freddieheineken
1 Solution
 
FuisseranCommented:
Would it be practical to have users page through the data?
0
 
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?
0
 
FuisseranCommented:
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
Loop

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.
0
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.
0
 
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:

http://www.google.fr/search?q=cache:Tub58W5jCI0C:p2p.wrox.com/archive/vb_howto/2003-01/18.asp+datagrid+flexgrid+datasource+speed&hl=fr&ie=UTF-8

thanks anyway fuisseran.


0
 
CleanupPingCommented:
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.
0
 
DigitalXtremeCommented:
question PAQ'ed and points refunded

DigitalXtreme
CS Moderator
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.

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