alter table syntax to add description to new fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi

i'm using ado in a vbscript (wsh/.vbs) to apply changes to user's local mdbs.

lots of "create table..." and "alter table..." commands are read from a file
and are executed by an adodb.connection object.

this is all working fine.

what i need to know is how can i add a description to a field (through an
'alter table' or 'create table' query via vbscript/ado) that will then be
visible in the 'description' column, when the table is opened (back in
access) in design mode?


if i've got oConn.Execute "ALTER TABLE customers ADD COLUMN somecolumn
TEXT(2) NULL", how can I change this so the new field 'somecolumn' will have
a description 'my description'? I need to do this for 'create table' and
'alter table'.

thanks very much

glipitch
 
You cannot add the Description property to a field via DDL query statements.

Instead, use the DAO library to CreateProperty() on the Field in the
TableDef of the Database.

Alternatively, use the ADOX library to set the Description property of the
Column in the Table of the Catalog.
 
Back
Top