Solved

Record number

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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create a path if not exists 7 124
Delphi Yen format 3 72
Base1 Encode/Decode 3 100
Tvertscrollbox like a whatsapp layout 5 68
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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