Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2007, 08:07 PM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 227
Default DBGrid with a lot of Records....Performance issue

Hi all
I have two form in my app,in first one i have a DBGrid with around 3000 Records and in second form i allow user to edit one record of this DBGRID. in the other hand when user click on EDIT button, i will open second form just for editing selected record.you may think this is stupid BUT for some reasons i have to implement EDIT in this way.
My problem is when user edits a record in second form and clicks on Ok button i Post the new data and close th second form and after that i REQUERY the First Form DBGrid to refresh the data......Here is my problem because i have a lot of recordsin this DBGRID , it takes a lot of time to populate records. is there any way to refresh or requery ONLY Edited record not all records???

Any help greatly would be appreciated.
Kind Regards
Reply With Quote
  #2  
Old 05-07-2007, 08:46 PM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: DBGrid with a lot of Records....Performance issue

Do you mind if I ask you what DB Engine you are using as
i have alot more records than that and the refresh is quite
quick?
Reply With Quote
  #3  
Old 05-07-2007, 11:52 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 4,773
Default RE: DBGrid with a lot of Records....Performance issue

Why don't you post the changes to the query on form1 so you don't have to re-query again something like:

[DELPHI]Form1.Query.Edit;
//Assign new values from Form2.
Form1.Query.Post;[/DELPHI]

Regards,
Abdulaziz Jasser
Reply With Quote
  #4  
Old 05-08-2007, 12:49 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 6,707
Default RE: DBGrid with a lot of Records....Performance issue

If you assign a dataset to the dbgrid and post directly on this you'll have no problems with performance. I also believe that the requery isn't needed when you use this approach...

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #5  
Old 05-08-2007, 02:49 AM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 227
Default RE: DBGrid with a lot of Records....Performance issue

Hi
Thanks guys
but as i said already for some reasons i have to edit my record manually through building UPDATE Command
(update testtable set field=....)

so in this way i have to REQUERY the dataset only for one record change!!!

kind regards.
Reply With Quote
  #6  
Old 05-08-2007, 02:53 AM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: DBGrid with a lot of Records....Performance issue

Did you try and set RequestLive to true, and then edit the
data directly?

Depends on how complicated the SQL is though.
Reply With Quote
  #7  
Old 05-08-2007, 02:54 AM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 227
Default RE: DBGrid with a lot of Records....Performance issue

Hi
Thanks for your reply
I'm using AdoDataset with sqlserver 2000

Kind Regards.
Reply With Quote
  #8  
Old 05-08-2007, 06:03 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: DBGrid with a lot of Records....Performance issue

Do you call the ReQuery method for TADODataset? Or do you call the Close/Open?

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #9  
Old 05-09-2007, 03:52 AM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 227
Default RE: DBGrid with a lot of Records....Performance issue

Hi Friend
I only use Requery() Method.

Regards.
Reply With Quote
  #10  
Old 05-09-2007, 01:24 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 4,773
Default RE: DBGrid with a lot of Records....Performance issue

What DB Engine are using? Give more details.

Regards,
Abdulaziz Jasser
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:33 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.