Adding column description to Access table, HOW?

  • Thread starter Thread starter Søren M. Olesen
  • Start date Start date
S

Søren M. Olesen

Hi

I'm trying to add a column and it's description to an Access table using the
following code:

objTable.Columns.Append("RefId", adInteger)
objTable.Columns("RefId").Properties("Description").Value = "Reference Id"

however I get the following exception:

"Item cannot be found in the collection corresponding to the requested name
or ordinal."

Looking at the Column using a debugger, I can see that the column doesn't
contain anything in the Properties collection...

But how do I add a Description to this collection ??

TIA

Søren
 
Think I've figured it out....you'll have to create the column with
description this way:

Dim col As ADOX.Column = New ADOX.Column
With col
.Name = name
.Type = type
.DefinedSize = size
.ParentCatalog = cat
.Properties("Description").Value = description
End With
 
Back
Top