Solved

Record number

Posted on 2000-03-10
4
250 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 100 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 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