"Ron Nolan" <rl**********@yahoo.com> wrote in message
news:13**************************@posting.google.c om...
Re: Access 2000
Does anyone know how to add column to a table using ADO?
I need to add a column called "autonum" that has a datatype of
"AutoNumber" to a table called "MyTbl".
I have searched far and wide. Books and news group threads are coming
up nill.
sql = "alter table MyTbl add id identity(1,1) not null"
CurrentProject.Connection.Execute sql, , adExecuteNoRecords
If you want to make it the primary key, (make sure you drop any existing PK
column first)
sql = "alter table MyTbl add id identity(1,1) not null constraint PK_MyTbl
primary key"
CurrentProject.Connection.Execute sql, , adExecuteNoRecords