Add a field to an existing table?

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nszmnsky
Posts: 15
Joined: Wed 21 May 2014 17:07

Add a field to an existing table?

Post by nszmnsky » Mon 12 Oct 2020 02:40

Is it possible to use LiteTable component to add a field - like is seen in the demo for VirtualTable?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Add a field to an existing table?

Post by MaximG » Tue 13 Oct 2020 15:34

Do you need to add a new TField class to the dataset or a new field to the SQLite table?

nszmnsky
Posts: 15
Joined: Wed 21 May 2014 17:07

Re: Add a field to an existing table?

Post by nszmnsky » Tue 13 Oct 2020 16:24

I need to add the field to the SQLite table. I know how to do it via "ALTER TABLE", so can go that route if can't be done by calling a procedure in the TLiteTable component.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Add a field to an existing table?

Post by MaximG » Fri 16 Oct 2020 09:52

TLiteTable is a descendant of the standard class TDataSet, which provides access to data and is not intended to modify database schema. To add a new column to an existing table, use the statement ALTER TABLE ADD COLUMN

nszmnsky
Posts: 15
Joined: Wed 21 May 2014 17:07

Re: Add a field to an existing table?

Post by nszmnsky » Sun 01 Nov 2020 15:07

Thanks Maxim! That is the route I had taken. Think I understand why TVirtualtable has .AddField but TLiteTable does not.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Add a field to an existing table?

Post by MaximG » Mon 02 Nov 2020 16:18

Please don't hesitate to contact us with questions concerning our product usage.

Post Reply