Solved

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

Posted on 2011-02-18
4
726 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 80
Working with hours 3 46
How to renew a Delphi rad-studio licence? 5 49
recursion example 16 111
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now