Delphi Pages Forums  

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

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-20-2003, 01:08 PM
nonumber nonumber is offline
Member
 
Join Date: May 2003
Posts: 41
Default refresh a DBGrid?? Anyone?

I'm trying desperately to have a DBgrid refresh whenever I press a click on a command button. I've used both methods, 'requery' & 'refresh'. The DBgrid's data is populated by a SQL query.
Reply With Quote
  #2  
Old 06-20-2003, 02:21 PM
Eddy-B Eddy-B is offline
Senior Member
 
Join Date: Feb 2002
Posts: 1,467
Default RE: refresh a DBGrid?? Anyone?

try to disconnect its DataSource property:
<cb><tt>
DBGrid1.DataSource:=nil;
DBGrid1.DataSource:=Query1;
</tt></cb>

regards,

Eddy-B

Please click <cr>Accept as answer</cr> if this helped</cr>
Reply With Quote
  #3  
Old 06-20-2003, 09:00 PM
savagerider savagerider is offline
Junior Member
 
Join Date: Jun 2003
Posts: 19
Default set dataset .active to false n true again

if button1 is used to refresh yr datagrid and dataset1 is yr ADO dataset then u can try this code

dataset1.active:=false;
dataset1.active:=true;

in fact u can put this under the save button ...
Reply With Quote
  #4  
Old 07-11-2003, 01:16 PM
nonumber nonumber is offline
Member
 
Join Date: May 2003
Posts: 41
Default RE: refresh a DBGrid?? Anyone?

hey thanks for the tip guys. However I'm not using any ado dataset. It's just a query. I got it to refresh by using:
Query1.close;
Query1.open;
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 04:38 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.