Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

896 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now