Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-12

[RESOLVIDO/SOLVED] TSqlite3Dataset: não salva os dados / don't save data

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Guionardo Furlan

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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091209/1af8220d/attachment.html>

Reply by email