try this:
Dim TargetCat As ADOX.Catalog
Dim TrgTbl As ADOX.Table
Dim oColumn As ADOX.Column
'open your connection
Set TargetCat = New ADOX.Catalog
TargetCat.ActiveConnection = "your connecion string here"
'get the table you want to add columns to
Set TrgTbl = TargetCat.Tables("TableName")
'now build your column object to append
Set oColumn = New ADOX.Column
With oColumn
.Name = "MyNewColumn"
.Type = <data type constant here> (adInt, adVarWChar, etc)
.DefinedSize = <how long? - not needed if a numeric type is used.>
End With
TrgTbl.Columns.Append oColumn
Set TrgTbl = Nothing
Set oColumn = Nothing
Set TargetCat = Nothing
hope this helps,
john
--- Gonzalo_Ruiz_de_Villa_Suárez <gonzalo.ruizdevilla@a...> wrote:
> I want to add a field to an access table using ADOX.
> Do you have any examples of how to do this?
>
> Thanks
>
> Gonzalo Ruiz de Villa Suárez
> Adesis Netlife
> Tel. (+34) 915 699 113
> Fax. (+34) 915 655 050
> e-mail: gonzalo.ruizdevilla@a...
> URL: http://www.adesis.com