Board index » delphi » adding fields dynamically

adding fields dynamically

Hello everybody,

I'm looking for a way to add fields to an existing table, without having
to build the whole table again. Also would I like to find out how I can
change the TField.Fieldtype dynamically.

Thanks for your respons, Mieke Janson

 

Re:adding fields dynamically


I use SQL (TQuery):

Here is some Sample SQL:

alter table Exhibito
add Test1 date,
add Test2 integer,
add Test3 money,
add Test4 char(10),
add Test5 Float,
add Test6 boolean,
add Test7 smallint

-----------------------
You can also use DROP instead of ADD to delete a field.

Quote
Mieke Janson wrote:
> Hello everybody,

> I'm looking for a way to add fields to an existing table, without having
> to build the whole table again. Also would I like to find out how I can
> change the TField.Fieldtype dynamically.

> Thanks for your respons, Mieke Janson

Re:adding fields dynamically


The easiest way to add a field to a table is to use a TQuery and the SQL
ALTER TABLE command.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Other Threads