AutoNumber data type

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

Guest

The following code works with all data types except AutoNumber. I get a
"Syntax error in field definition" error message. Can anyone help me make
AutoNumber work?

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Datetime);"
 
I get the same error message with:

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Identity);"
--
Thank you,
Del


Douglas J. Steele said:
I believe you use Identity rather than Autonumber.
 
Sorry, that's what I get for not looking it up.

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Counter)"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Del said:
I get the same error message with:

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Identity);"
 
Douglas J. Steele said:
Sorry, that's what I get for not looking it up.

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Counter)"


The identity syntax works, but on an ADO connection, for instance

CurrentProject.Connection.Execute _
"CREATE TABLE tblTest(XYZ Int Identity);"
 
Back
Top