Adding field to existing table 
Author Message
 Adding field to existing table

my project have been block by the following problem...

I am using ADO.
I created a table, lets say 'Brand'. In the table, I have made the following
field, let say 'Compaq', 'Dell', 'Acer'. I want to add a field to this table
at runtime, let say, 'Toshiba' by capturing an input from a edit box.

I am unable to find any ways to do it (adding a field to an existing table)
and I appreciate any help very much .

Thank you.

Vyn



Wed, 07 Dec 2005 17:49:38 GMT  
 Adding field to existing table

Quote:

> my project have been block by the following problem...

> I am using ADO.
> I created a table, lets say 'Brand'. In the table, I have made the following
> field, let say 'Compaq', 'Dell', 'Acer'. I want to add a field to this table
> at runtime, let say, 'Toshiba' by capturing an input from a edit box.

> I am unable to find any ways to do it (adding a field to an existing table)
> and I appreciate any help very much .

> Thank you.

> Vyn

Seems that this would be easy using a Sql ALTER TABLE statement - something like:

MyDatamodule.mySQLComponent.Active := False;
MyDatamodule.mySQLComponent.SQL.Clear;
MyDatamodule.mySQLComponent.SQL.Add('ALTER TABLE BRAND ADD ' + Edit1.Text +
        ' varchar(20)');
MyDatamodule.mySQLComponent.ExecSql;

HTH,

John



Fri, 09 Dec 2005 03:40:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Delhpi - Adding field in an existing Paradox table

2. Adding a New Field to an existing Database Table

3. Adding Fields and Indices to Existing Tables

4. Add a new Database field to a already-existing Paradox table at RUNTIME

5. adding a new field to existing table

6. Help please! Can't add fields to existing tables.

7. !!In need of URGENT help!! How to add fields to existing tables.

8. How to append fields to existing tables, without damageing the existing data

9. Adding fields programmatically to existing

10. IB How to add an domain to an existing field

11. Apollo DBE, Add a field to existing DBF?

12. Q : adding fields to existing paradox files

 

 
Powered by phpBB® Forum Software