[Lazarus] Master-Detail in sqldb broken?

Michael Van Canneyt michael at freepascal.org
Wed Dec 29 15:01:36 CET 2010

On Wed, 29 Dec 2010, Julio César Gázquez wrote:

> Hi all.
> I have a master detail form, I'm using SQLDB and running a current snapshot 
> (Lazarus-0.9.29 rev 28828).
> Retrieving data works Ok. Saving changes doesn't. Googling I found old 
> comments in the mailing list saying primary keys must be integers. Is yet 
> that the case? If it isn't, component declaration and relevant code follows.

Primary keys do not have to be integers.

> Another issue, when the master have more than 1 record, if I edit the detail, 
> then move around in the master, detail changes are lost. IIRC this works fine 
> in dbExpress. It is a bug or a design limitation of sqldb?

This is because updates are cached by default. 
You must save all updates (applyupdates) in the OnBeforeClose event of the detail dataset.


More information about the Lazarus mailing list