Page 1 of 1

Strange edit behavior

Posted: 01.11.2009, 06:20
by PhillHS
Ok, so I'm trying to write a simple game launcher and using sqllite as the backend.

I have a form where I can edit the game configurations that has the following components all linked to the same DataSource, which is liked to a ZQuery and then to a ZConnection to the database.

The components I have are

Code: Select all

    GameProfiles: TDBGrid;
    GameName: TDBEdit;
    GameIWad: TDBLookupComboBox;
    GamePWADList: TDBListBox;
    GameParams: TDBEdit;
I have a popup menu set on the TDBGrid that executes the code :

Code: Select all

procedure TDoomMainForm.AddProfile1Click(Sender: TObject);
begin
  GameProfiles.DataSource.DataSet.Append;
end;
This seems to insert a blank record as one appears in the list, however as soon as I move the focus away from the TDBGrid and onto another component, even a non DB aware one, the blank record dissapears and the previous record is displayed.

Is this a bug ? Something I'm doing wrong, or something to do with sqllite, I don't seem to remember having this problem with MySQL.

I may temportally change the backend to MySQL and see if the problem still exists there.

Cheers.

Phill.

Posted: 01.11.2009, 23:14
by mdaems
GameProfiles.DataSource.DataSet.Append
Just sets the dataset in Append mode. A new record is made ready for accepting values. So I can imagine the standard behaviour is to undo this preparation when the focus moves away from the dataset without setting a valu or issuing a Post statement.

Mark