Solved

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

Posted on 2003-11-12
5
189 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
[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
  • 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

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

Suggested Solutions

Title # Comments Views Activity
Dev Express grid collapse 2 47
Convert MS Word document to a PDF file 9 114
How to convert memory stream to PDF file 6 170
FMX TEdit KeyUp handler detecting  "enter" key 4 36
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…

735 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