Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

15 Experts available now in Live!

Get 1:1 Help Now