?
Solved

Record number

Posted on 2000-03-10
4
Medium Priority
?
253 Views
Last Modified: 2010-04-04
I use Delphi 3.o with Interbase.

I want to refresh a query in a dbgrid and stay at the currend record. You can't do this with:
Query1.refreh;

Instead I can close and open the query:

Query1.close;
query1.open;

But then my curor goes to the first record in the DBgrid. Is there a way to store the recordnumber and return to that later ?
0
Comment
Question by:RichardBorst
[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
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2603667
hi richard,

just remember a unique field(s) into a var and do a locate after the reopen.

meikl
0
 
LVL 12

Accepted Solution

by:
Faruk Onder Yerli earned 300 total points
ID: 2603697
You can use TBookMark;

uses db;

var
  BookMark : TBookMark;
begin
  BookMark := Query1.GetBookmark;
  Query1.Close;
  Query1.Open;
  Query1.GotoBookmark(BookMark);
  Query1.FreeBookmark(BookMark);
end;

0
 
LVL 9

Expert Comment

by:ITugay
ID: 2603708
dear richard,

I'm not sure about D3, but in D5 & IB5.6 you may do it like this:

var B : TBookmark;
......
  B:=Query1.GetBookmark;
  Query1.Close;
  Query1.Open;
  Query1.GoToBookmark(B);
.....

Cheers,
Igor.
0
 

Author Comment

by:RichardBorst
ID: 2618994
Both kretzschmar and equalizer's will work. (Itried both).

I prefer the solution from equalizer's
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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month12 days, left to enroll

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