Solved

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

Posted on 2003-11-12
5
187 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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