Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Refreshing data

Posted on 2003-02-24
7
Medium Priority
?
216 Views
Last Modified: 2010-04-04
at the moment, I have a screen that then moves to one of two forms.  The problem I have is that when I view the form, go out and select another record and go back in, the displayed data is still the data from the previous record.

I need somehow to refresh the data without clearing the SQL or the query because that looses all the SQL which specifies the records to find.  
0
Comment
Question by:gleads
  • 3
  • 3
7 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8007719
try to establish a master-child relation
in delphi (properties mastersource,masterfield of the dataset).

otherwise you have to relocate the form2-data
in the afterscroll-event of the dataset on form1

meikl ;-)
0
 

Expert Comment

by:GummiStori
ID: 8026968
query1.requestlive := true;
0
 

Author Comment

by:gleads
ID: 8031930
requestlive what is this?
0
Technology Partners: 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!

 

Expert Comment

by:GummiStori
ID: 8032698
No sorry.. I meant query1.AutoRefresh := true;
It's a property in the Object Inspector

From delphi help:
"When AutoRefresh is true, field values are automatically refreshed without an explicit call to the Refresh method."

I hope it helps

Gummi St.
0
 

Author Comment

by:gleads
ID: 8032717
I am using an ADO connection will this still work?
0
 

Accepted Solution

by:
GummiStori earned 90 total points
ID: 8032877
No this is only in BDE
sorry,

but your query is in another form, then you can let the form refresh the query when it's activated, by using the onActivate event for the form

procedure TForm2.FormActivate(Sender: TObject);
begin
  AdoQuery1.Refresh;
end;

so when you select the form "focus on it or select it" it will refresh your query


Gummi St.
0
 

Author Comment

by:gleads
ID: 8032983
it says insufficient base table information
0

Featured Post

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

578 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