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

Re: Adding column description to Access table, HOW? by Søren

Søren
Thu Jul 13 06:38:11 CDT 2006


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




"Søren M. Olesen" <smolesen@hotmail.com> wrote in message
news:OYvkIQmpGHA.4760@TK2MSFTNGP05.phx.gbl...
>
> 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
>