alter table syntax to add description to new fields

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
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top