Insert record into Access

Discussion in 'HTML' started by Otuatail, Dec 9, 2003.

  1. Otuatail

    Otuatail Guest

    Sorry for my last posting I found this works
    rsWeeks.Open sqlAddWeek, connection
    but I have set an auto number ID in the table and marked it as a primary Key
    But it insists that I add a value here. What do I do to omit this
    from my query in Can I modify the Table.

    Paul.
     
    Otuatail, Dec 9, 2003
    #1
    1. Advertising

  2. (Otuatail) wrote in message news:<>...
    > Sorry for my last posting I found this works
    > rsWeeks.Open sqlAddWeek, connection
    > but I have set an auto number ID in the table and marked it as a primary Key
    > But it insists that I add a value here. What do I do to omit this
    > from my query in Can I modify the Table.


    There's no HTML to do this. If you had a two field access table
    (userName):
    ID (AutoNumber, Primary Key)
    myName (255)
    you should be able to do
    INSERT IN TO userName (myName) VALUES ('Hywel')

    The ODBC driver should sort the autonumber field for you, after all,
    how can you be sure that you know the actual value you need? Unless
    you did a MAX on that field, incremented the value returned and then
    used that.

    --
    Hywel
     
    Hywel Jenkins, Dec 9, 2003
    #2
    1. Advertising

  3. Otuatail

    Clive Moss Guest

    "Otuatail" <> wrote in message
    news:...
    > Sorry for my last posting I found this works
    > rsWeeks.Open sqlAddWeek, connection
    > but I have set an auto number ID in the table and marked it as a primary

    Key
    > But it insists that I add a value here. What do I do to omit this
    > from my query in Can I modify the Table.
    >
    > Paul.
    >


    For starters your sql statement should give the field names:

    sqlAddWeek = "INSERT INTO Weeks Field1, Field2, Field3, Values('" & FullDay
    & "'," & cint(sMonth) & ","
    & SelWk & ")"

    CM
     
    Clive Moss, Dec 9, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmVmZg==?=

    Insert multiple record into table using ado.net ?

    =?Utf-8?B?SmVmZg==?=, Apr 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    993
    =?Utf-8?B?SmVmZg==?=
    Apr 14, 2004
  2. =?Utf-8?B?ZGF2aWQ=?=

    Help: Insert record into database

    =?Utf-8?B?ZGF2aWQ=?=, Oct 23, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    394
    =?Utf-8?B?ZGF2aWQ=?=
    Oct 24, 2006
  3. deneushasler
    Replies:
    3
    Views:
    436
    deneushasler
    Jul 3, 2008
  4. Frits van Soldt

    How to insert a new record in detailsview when there are no record

    Frits van Soldt, Nov 16, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    807
    Frits van Soldt
    Nov 17, 2005
  5. Guest
    Replies:
    1
    Views:
    279
    Alex G
    Jan 9, 2004
Loading...

Share This Page