Reputation: 1477
I am trying to create a table with a column whose AutoIncrement is Yes. Here is my query not sure what's wrong in it
CREATE TABLE testallcols(SOCycle Text(3), AutoKey integer AUTOINCREMENT NOT NULL, SOData LongBinary NOT NULL)
How do I get my AutoKey column to be an auto increment integer?
Upvotes: 5
Views: 9891
Reputation: 281
CREATE TABLE Tblcontacts ( contactid AUTOINCREMENT(101,1) PRIMARY KEY , firstname CHAR (60), lastname CHAR (60), email VARCHAR (75) );
Upvotes: -1
Reputation: 97101
AUTOINCREMENT
and integer
are two different datatypes as far as Access DDL is concerned. Use only AUTOINCREMENT
. And to make it function correctly as an autonumber, include the PRIMARY KEY
constraint.
This one works without error when tested with ADO/OleDb in Access 2010:
CREATE TABLE testallcols(SOCycle Text(3), AutoKey AUTOINCREMENT PRIMARY KEY, SOData LongBinary NOT NULL)
Upvotes: 8