Adding / Appending fields to existing table 
Author Message
 Adding / Appending fields to existing table

Hi Marshall,

See the example below excerpted from MDAC 2.5 SDK for how to append a column
to a table.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
Columns and Tables Append Methods, Name Property Example (VB)

The following code demonstrates how to create a new table.

Sub CreateTable()

   Dim tbl As New Table
   Dim cat As New ADOX.Catalog

'Open the catalog.
   ' Open the Catalog.
   cat.ActiveConnection = _
      "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=c:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind.mdb;"

   tbl.Name = "MyTable"
   tbl.Columns.Append "Column1", adInteger
   tbl.Columns.Append "Column2", adInteger
   tbl.Columns.Append "Column3", adVarWChar, 50
   cat.Tables.Append tbl

End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ling


Quote:
> I have an exisiting table and would like to add functionality that would
> give the user the capability to add a new field to the table. Is this
easily
> done using the ADO Append method?

> Does anyone have some sample code, they could share?

> Regards

> Marshall Brown



Sun, 12 Jan 2003 03:00:00 GMT  
 Adding / Appending fields to existing table
I have an exisiting table and would like to add functionality that would
give the user the capability to add a new field to the table. Is this easily
done using the ADO Append method?

Does anyone have some sample code, they could share?

Regards

Marshall Brown



Mon, 13 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to modified existing field and add new field in existing table for Access database

2. append fields to an existing table using DAO

3. Appending an AutoIncrement field to an existing table

4. Appending fields to existing Access Table

5. Create new field in existing table exactly like field in second table

6. Adding required fields with default values to existing tables

7. Adding new fields to an existing table

8. Adding Tables and Fields to an existing database

9. Adding fields to existing ADO tables

10. Add New Field in existing Table (VB6)

11. Adding required fields with default values to existing tables

12. Adding a new field to an existing table via ADOX

 

 
Powered by phpBB® Forum Software