SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Microsoft Access AUTONUMBER (auto increment)

    Hi guys,

    I am using php to create a table in a microsoft access database like so:

    Code:
    $sql = "CREATE TABLE unprocessed(
    id INT NOT NULL,
    account varchar(10),
    add1 varchar(75),
    add2 varchar(75),
    add3 varchar(75),
    add4 varchar(75),
    add5 varchar(75),
    add6 varchar(75),
    PRIMARY KEY(id));";
    I want the id column to auto increment or as MS likes to call it autonumber, and am at a loss as how to do it within a command line query. Any help would be great, thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    http://support.microsoft.com/kb/180841

    CREATE TABLE unprocessed
    ( id COUNTER NOT NULL
    , ...


    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    CREATE TABLE unprocessed
    ( id COUNTER NOT NULL
    , ...


    Excellent, thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •