Insert Autonumber column to a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I found the following code to insert a column to a table. The code creates
the column as text (works great). Can I change this to autonumber? If so
how?

Dim strSQL As String
strSQL = "ALTER TABLE tblTest ADD COLUMN MyNewTextColumn nvarchar(50)"
CurrentProject.Connection.Execute strSQL, , adCmdText

as always thank you very much!

Robert
 
Found my answer already:

Dim strSQL As String
strSQL = "ALTER TABLE tblTest ADD COLUMN MyNewTextColumn counter"
CurrentProject.Connection.Execute strSQL, , adCmdText
 

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

Similar Threads


Back
Top