Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   DB-Aware (http://www.delphipages.com/forum/forumdisplay.php?f=5)
-   -   refresh a DBGrid?? Anyone? (http://www.delphipages.com/forum/showthread.php?t=92270)

nonumber 06-20-2003 01:08 PM

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.

Eddy-B 06-20-2003 02:21 PM

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>

savagerider 06-20-2003 09:00 PM

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

nonumber 07-11-2003 01:16 PM

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;


All times are GMT. The time now is 05:21 PM.

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