Buenas

Usando o TSqlite3Dataset em um form com DBGrid, devidamente conectados,
verifiquei que os dados não eram salvos no arquivo, mesmo executando
ApplyUpdates.
Além disso, ApplyUpdates retorna FALSE.

Depois de alguma pesquisa, descobri que é necessário:

Para o banco definido por:

CREATE TABLE [veiculos]
(   [id] INTEGER CONSTRAINT "ID" NOT NULL,
    [nome] VARCHAR (40),
    PRIMARY KEY ([id]),
    UNIQUE ([id]))

- Definir "PrimaryKey" com o nome do campo de chave primária (no meu caso,
"ID", definido no banco de dados)
- Definir a propriedade: AutoIncrementKey para True
- Definir a propriedade: SaveOnClose para True
- Definir a propriedade: SaveOnRefetch para True

E pronto.

---------
Google Translation

Buenas

Using TSqlite3Dataset in a form with DBGrid, properly connected, I found
that the data were not saved in the file, even running ApplyUpdates.
Moreover, ApplyUpdates returns FALSE.

After some research, I discovered that you need:

- Define "PrimaryKey" with the name of the primary key field (in my case,
"ID" as defined in the database)
- Set the property: True to AutoIncrementKey
- Set the property: True to SaveOnClose
- Set the property: True to SaveOnRefetch

're Done.

-- 
Timeo hominem unius libri
Cogito ergo sum - Carpe diem

[]s
Guionardo Furlan
http://guionardo.blogspot.com
http://www.guionardofurlan.com.br
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to