?
Solved

Refreshing data

Posted on 2003-02-24
7
Medium Priority
?
215 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
[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
  • 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
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!

 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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