Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-11

Should Insert+Edit Fields+Insert again on a TDataSet work?

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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.

thanks,

Felipe Monteiro de Carvalho
John & Marg Sunderland
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
Ok, so I managed to get a DBE application working and it has the same behavior as the ADO one.

I believe it should be posted (kept). In general, at least in Delphi - I think throughout the Borland world - if you navigate off a record you have inserted or edited, the edited record is posted. I think inserting another record is just another way of navigating off the edited record.

cheers,
John Sunderland

Graeme Geldenhuys
to Felipe Monteiro de Carvalho: Ok, so I managed to get a DBE application working and it has the same behavior as the ADO…
Felipe Monteiro de Carvalho wrote 5 lines
Ok, so I managed to get a DBE application working and it has the same behavior as the ADO one. From my Delphi days, what I remember is that the data gets saved

(posted) as soon as you move to another record. Using your example with the DBNavigator, doing another insert, moves to a new record, so the old record must be posted (saved).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Marc Santhoff
to Felipe Monteiro de Carvalho: Please take a look at the following discussion on this bug report:…

Am Samstag, den 24.11.2007, 09:44 +0100 schrieb Felipe Monteiro de Carvalho:

Show quoted text 26 lines
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