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

how to create idenitity Field in Ms Access 2003 with SQL Command

P: 7
Dear Experts..

i need create table with identiry field .. if i use GUI ..i just click and choose autonumber as type ... but i try with SQL Stement :

"Create Table Test (id autonumber, Desc Text(50))"

i get error message that syntax error in filed definition..
i try again .. i change "autonumber" with "identiry"
and.. i get error message again..

can u give me advice with this matter ?

thanks anyway

-junis-
Sep 19 '07 #1
Share this Question
Share on Google+
1 Reply


Scott Price
Expert 100+
P: 1,384
The autonumber property is not available through an SQL statement like you are attempting.

You'll need to explore the DAO TableDefs, Index, Attributes and specifically dbAutoIncrField keywords in the VBA help file.

Basically the process is: create a new TableDef, Append the fields you wish to this new tabledef, create a new index for the new tabledef, set the new index's attributes to dbAutoIncrField...

Regards,
Scott
Sep 20 '07 #2

Post your reply

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