By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,971 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,971 IT Pros & Developers. It's quick & easy.

How to create a table in access 2007 with AutoNumber Datatype

P: 23
I want to create a table in access 2007 by query not in design view. My table should look like;
Serial AutoNumber
Name Text
Country Text
I am using the following query:
CREATE TABLE Details (Serial AutoNumber, Name TEXT, Country Text)


But its returning an error (Sysntax error in field definition ) with AutoNumber Highlighted .Plzz help
Aug 13 '10 #1
Share this Question
Share on Google+
2 Replies


P: 14
... what i can tell is that to reste autonumber ina access is "CurrentDB.Execute "ALTER TABLE tablename ALTER COLUMN ColumName COUNTER(1,1)"

so try changing the data type to Counter...

hope thhis help
Aug 13 '10 #2

NeoPa
Expert Mod 15k+
P: 31,419
As Dracko says, the thing to use is Counter(1,1), rather than AutoNumber. In fact you can create the table directly this way with :
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE Details (Serial Counter(1,1),
  2.                       Name TEXT,
  3.                       Country Text);
A Best Answer for Dracko on this one may be appropriate :)
Aug 16 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.