Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data grid speed

Status
Not open for further replies.

zyonman

Programmer
Jul 17, 2002
7
0
0
PT
Can someone help me with this?
I need to retrive about 60000 records to a data grid and then about more 30000 records to other datagrid. The problem ist that it takes to loong. Can somebody tell me the best way to retrive all this data?

Code sample:
private sub refresh_records()
adodcsrcar.RecordSource = "SELECT col002, COL006 FROM expar ORDER BY col002"
adodcsrcar.Refresh
Set gridsrcAr.DataSource = adodcsrcar
gridsrcAr.Columns(0).DataField = "col002"
gridsrcAr.Columns(1).DataField = "col006"
adodcsrcdesc.RecordSource = "SELECT col002, COL006 FROM expar ORDER BY col006"
Set gridsrcdesc.DataSource = adodcsrcdesc
gridsrcdesc.Columns(0).DataField = "col002"
gridsrcdesc.Columns(1).DataField = "col006"
end sub


 
Wow, do you really need to show 60000 records to the user. If the answer is yes I know that some grids will only get and show records that are needed to show on the screen. Might want to look into True DB Grid. How about showing the first 1000 records and then have a button that would get the next 1000 records.
John
 
The biggest delay is caused by the sorting...
Removing the sort would be a quick way. Allow the user to sort themselves when a column header is clicked.
Is COL006 indexed?
What type of cursor are you using? Is the data on a server? What type of database?


 
it's a very simple query as you see.

How do i retrive about those 1000 records u are saying using code and Dbgrid?????
 
CCLINT

The main problem is were:
Set gridsrcAr.DataSource = adodcsrcar

when i set the datasource to the grid the binding is very slow...

I'm using SQL server 7, win a server with 512Ram, is a PIII 800Mhz? shouldn't have any problem with the server...
 
It still shouldn't take too long with only two columns.
Step through through the code (put a toggle on the first line and when it stops there, press F8 to step through). The delay is most likely when you step through the refresh method - how long does it take?

Again, what type of cursor is adodcsrcar using?
Also, you have the data with the first recordset. Why not create a clone and use that for the second?
Also, remove the lines of code where the column's DataFields are being set.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top