Results 1 to 2 of 2
  1. #1
    JTeagle is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    2

    Question CREATE TABLE and AutoNumber fields

    I'm trying to create a table that contains an AutoNumber field using the following SQL:

    Code:
     
    CREATE TABLE [tmpTable] ([ID] AutoNumber);

    but I get a COM error stating that there's an error in the field description. If I use Long as the data type it accepts it, but according to w3schools online AutoNumber is a perfectly valid Access data type.



    I've tried it with all lowercase, with PRIMARY KEY and a few other combinations but it simply refuses. Can anyone tell me what I'm doing wrong here?

    I'm using ADO (#importing msado15.dll).



  2. #2
    JTeagle is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    2
    Quote Originally Posted by JTeagle View Post
    but according to w3schools online AutoNumber is a perfectly valid Access data type.
    What it doesn't tell you is that you can't actually use that word - I discovered after a bit more of a hunt this morning that I needed to use COUNTER.

    Sorry for bringing a question and answering it 5 seconds later...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 08-05-2011, 08:13 PM
  2. Updating Autonumber Fields
    By Rawb in forum Code Repository
    Replies: 4
    Last Post: 02-21-2011, 07:17 AM
  3. Importing existing Autonumber fields
    By prophecym in forum Import/Export Data
    Replies: 3
    Last Post: 02-05-2011, 09:59 AM
  4. Replies: 7
    Last Post: 01-06-2011, 12:34 PM
  5. Create new fields
    By thart21 in forum Queries
    Replies: 7
    Last Post: 04-15-2010, 07:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums