CT
Fri Oct 28 02:14:29 CDT 2005
You need to use the DataTypeEnum.adInteger and then set the AutoIncrement
property;
Dim tbl As New Table
Dim col as New Column
tbl.Name = "Table1"
col.Name = "Field1"
col.Type = DataTypeEnum.adInteger
' Add column to the catalog
col.ParentCatalog = catalog ' Of type ADOX.Catalog
col.Properties("Autoincrement") = True
tbl.Columns.Append(col)
--
Carsten Thomsen
Communities -
http://community.integratedsolutions.dk
"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:7265BC18-8D90-4013-8AC8-87F955A76E02@microsoft.com...
> I'm writing a VB.Net program. At startup the program looks for a default
> Access mdb and if it isn't there, creates it. At least that's the design.
>
> My question is this: Using ADOX, is there anyway to declare an
> AutoIncrement table field? I don't see anything in the DataTypeEnum that
> seems equivalent.
>
> Dim tbl As New Table
> tbl.Name = "Table1"
> tbl.Columns.Append("Field1", ??????? )