Solved

How to auto refresh the data in my TBGRID which is linked with TADO Query /  TDatasource?

Posted on 2011-02-18
4
735 Views
Last Modified: 2012-05-11
I have the data displayed in the Grid. Right now when they click the update button the data gets refreshed. How can i automate the update. Like every 5 mins i would like the data to be refreshed?

Thanks in Advance.
0
Comment
Question by:hawkerpac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 34929752
Use a TTimer and call TAdoQuery.Refresh in OnTimer event...
0
 
LVL 19

Expert Comment

by:Thommy
ID: 34929793
You can also try using DBGrid.refresh...
0
 

Author Comment

by:hawkerpac
ID: 34929829
can you please give me the syntax? code?

Thanks
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 34929954
Place a TTimer on your form, set interval to 5000 ms (5 mins) and set enabled:=true


type
    TfMain = class(TForm)
    Timer1: TTimer;
    procedure TimerTimer(Sender: TObject);

  private
        
...

implementation

{$R *.dfm}

procedure TfMain.Timer1Timer(Sender: TObject);
begin
  ADOQuery1.Refresh;
  //DBGrid1.Refresh;
end;

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how can i search if string exist in array ? 3 80
Problem to page 4 107
firemonkey keyboard covers the controls 1 83
firemonkey Android Listview Sort items 7 111
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question