[fpc-pascal] Should Insert+Edit Fields+Insert again on a TDataSet work?

Marc Santhoff M.Santhoff at t-online.de
Sat Nov 24 19:36:12 CET 2007


Am Samstag, den 24.11.2007, 09:44 +0100 schrieb Felipe Monteiro de
Carvalho:
> Hi,
> 
> Please take a look at the following discussion on this bug report:
> 
> http://www.freepascal.org/mantis/view.php?id=10165
> 
> The question is very simple. Suppose a trivial data-aware application
> with a DBNavigator and a number of DBEdits. The following steps:
> 
> 1 - Click insert on the DBNavigator
> 
> 2 - Add some text to the DBEdits
> 
> 3 - Click insert again on the DBNavigator
> 
> Now, what should happen? Should the first inserted record be persisted or lost?
> 
> I don't know how to use any other database method on my TurboDelphi
> except ADO, and there this works.
> 
> Does anyone know if this should actually work, or if this just works
> with ADO and shouldn't work with any other dataset?
> 
> The question is relevant to fpc because some fpc datasets don't allow
> the 3 steps above and I already saw the data be inserted in the wrong
> order, or even simply lost.

Most Database apps have the idea of an "insert row", that is a fresh new
record created on the "new/insert"-event or when the user navigates
after the last record from the underlying table.

If this insert row record (only existing on the client side) is filled
with at least some data and the user clicks "insert" again the insert
row is posted to the table and emptied, so a second new record is
prepared at the client (not posted yet). But it is only one at a time.

HTH,
Marc





More information about the fpc-pascal mailing list