Strange edit behavior

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
PhillHS
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 23.05.2007, 14:11
Location: Coventry, UK

Strange edit behavior

Post 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.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Post Reply