2

I have to programmatically update a large number of Access-97 databases with new tables and columns, and wish to fill in the description for each of the new column. To this end I have created code along the following lines:-

Dim MyTable  As TableDef
Dim NewField As Field

' Fill in MyTable...

Set NewField  = MyTable.CreateField("MyColumn")
NewField.Type = WantedType
NewField.Size = WantedSize

MyTable.Fields.Append NewField

but there is no property NewField.Description.

I try to create such a property thus:-

Call NewField.CreateProperty("Description", dbText, "My Comment", True)

but this does nothing.

Abandoning this approach I tried to create an SQL statement to execute to set the description, starting like this:-

ALTER TABLE MyTable ALTER COLUMN MyColumn

but it transpires that Access 97 has no ALTER COLUMN ability. Neither is there any command COMMENT ON COLUMN MyColumn as there is on some database engines.

Is there anything else I can try to fill in the Description of a column from a program?

StayOnTarget
  • 7,829
  • 8
  • 42
  • 59
Brian Hooper
  • 20,414
  • 23
  • 82
  • 132

0 Answers0