Adding column description to Access table, HOW?

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
 
S

Søren M. Olesen

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
 

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