Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    insert values to access table

    Hi all,

    i have created a table in MSAccess and the primary key i have set to Autonumber.
    but while inserting from the code part how i can give a value to the primary key in the insert statement.

    please give me a solution as soon as possible
    thanks in advance
    Dev.

  • #2
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    primary key as an autonumber means the number increases by 1 by each row,
    you can not change an autonumber...

    leave the autonumber out of the insert statement and jus tinsert your other data...

  • #3
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the problem is if i leave primary key its says wrong no of arguements passed to the query.

  • #4
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Post your SQL...


  •  

    Posting Permissions

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