Hi!
A couple of days ago I installed Lazarus 1.8 and migrated my applications to this version. I tested them and all was ok. Today I'm making some tests and I've found a problem: when I select an item in a TdbComboBox it doesn't change the value in the database. When I "post" the dataset it shows again the old value, and this old value remains in the table.
I've tried to do it programatically and it seems very strange too: first time it doesn't change the value and second time it works.
if (qVisitas.State = dsEdit) or (qVisitas.State = dsInsert) Then
begin
qVisitas.FieldByName('DIFICULTAD_VISITA').AsInteger := StrToInt(dbcbDificultad.Items[dbcbDificultad.ItemIndex]);
end
else if qVisitas.RecordCount > 0 then
begin
qVisitas.Edit;
qVisitas.FieldByName('DIFICULTAD_VISITA').AsInteger := StrToInt(dbcbDificultad.Items[dbcbDificultad.ItemIndex]);
qVisitas.Post;
end;
First time qVisitas is not in editing nor inserting state, so it goes to the second condition, it changes to Edit state, it changes the field and it posts. But nothing changes. In a second it returns to the old value.
If I try again, it executes the first condition ( :O), it changes the field and it works.
I'm lost. With Lazarus 1.6.4 it worked perfectly, without extra code. I pressed a value and it changed in the control and in the table.
Any suggestions? Thanks in advance