Solved

Using the Tdataset.post method in BDE causes the program to lose current

Posted on 2003-11-12
5
188 Views
Last Modified: 2013-11-23
Hello.

I'm using Delphi 6 and BDE to work against an Oracle or SQL server database (native connection).

During the application, I'm running a select statement that does not return a value in order to create an empty dataset. After filling some data in the recordset I use the post method to save the record. The problem is that after doing the post method, I lose the current record and have an empty dataset, which requires me to re-query the table to retrieve the current record.

Any idea how to solve this problem?

Thanks.
0
Comment
Question by:yronnen
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 9730469
use cachedupdates

in the post-event use the a code like

begin
  try
    Dataset.ApplyUpdates;
    Dataset.CommitUpdates;
  except
    Dataset.CancelUpdates;
    raise;
  end;
end;

or just close and reopen your query instead of cachedupdates

meikl ;-)
0
 
LVL 5

Author Comment

by:yronnen
ID: 9730768
meikl,

The problem is that if I reopen my query, it means that I'm going to the database
again, which is exactly what I want to prevent.

Will using cached updates make me stay on the current record?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9730901
>Will using cached updates make me stay on the current record?

should be so,
not sure,
because of rare knowledge about what and how you do it
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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