What am I doing wrong; problem with INSERT statement (ASP/MS ACCESS)

Discussion in 'ASP General' started by Jason Melville, Sep 7, 2003.

  1. Does column desc allow empty strings?

    "Simom Thorpe" <> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to insert a line into a MS access DB using ASP on IIS 5.
    >
    > This is the line:
    >
    > con.execute "INSERT INTO newProds(title,desc,catcode) VALUES
    > ('Champagne Muff Scarf','','AC304B')"
    >
    > But it throws up this error:
    >
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    >
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    > statement.
    >
    > /admin/import/newprods.asp, line 37
    >
    > I've been staring at the line for 40 mins now and I can't see a damn
    > thing wrong with it; hopefully a new set of eyes can see a bug!
    >
    > What am I doing wrong??
    >
    > Simon.
     
    Jason Melville, Sep 7, 2003
    #1
    1. Advertising

  2. Jason Melville

    Simom Thorpe Guest

    Hi,

    I'm trying to insert a line into a MS access DB using ASP on IIS 5.

    This is the line:

    con.execute "INSERT INTO newProds(title,desc,catcode) VALUES
    ('Champagne Muff Scarf','','AC304B')"

    But it throws up this error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    statement.

    /admin/import/newprods.asp, line 37

    I've been staring at the line for 40 mins now and I can't see a damn
    thing wrong with it; hopefully a new set of eyes can see a bug!

    What am I doing wrong??

    Simon.
     
    Simom Thorpe, Sep 7, 2003
    #2
    1. Advertising

  3. Jason Melville

    Ray at Guest

    desc is a reserved SQL keyword. Either rename your column to DESCRIPTION or
    something like that, or bracket the name. i.e.

    "INSERT INTP newProds(title,[desc],catcode)...

    Ray at home

    --
    Will trade ASP help for SQL Server help


    "Simom Thorpe" <> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to insert a line into a MS access DB using ASP on IIS 5.
    >
    > This is the line:
    >
    > con.execute "INSERT INTO newProds(title,desc,catcode) VALUES
    > ('Champagne Muff Scarf','','AC304B')"
    >
    > But it throws up this error:
    >
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    >
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    > statement.
    >
    > /admin/import/newprods.asp, line 37
    >
    > I've been staring at the line for 40 mins now and I can't see a damn
    > thing wrong with it; hopefully a new set of eyes can see a bug!
    >
    > What am I doing wrong??
    >
    > Simon.
     
    Ray at, Sep 7, 2003
    #3
  4. Jason Melville

    Simom Thorpe Guest

    Thanx for your help guys, you were right; desc is a reserved word. I
    fixed it by using [desc].

    Cheers,

    Simon.


    (Simom Thorpe) wrote in message news:<>...
    > Hi,
    >
    > I'm trying to insert a line into a MS access DB using ASP on IIS 5.
    >
    > This is the line:
    >
    > con.execute "INSERT INTO newProds(title,desc,catcode) VALUES
    > ('Champagne Muff Scarf','','AC304B')"
    >
    > But it throws up this error:
    >
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    >
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    > statement.
    >
    > /admin/import/newprods.asp, line 37
    >
    > I've been staring at the line for 40 mins now and I can't see a damn
    > thing wrong with it; hopefully a new set of eyes can see a bug!
    >
    > What am I doing wrong??
    >
    > Simon.
     
    Simom Thorpe, Sep 16, 2003
    #4
  5. Jason Melville

    PB4FUN Guest

    I allways use Descr for Description, you might forget the [] the next time.

    Meindert, MCP

    > Thanx for your help guys, you were right; desc is a reserved word. I
    > fixed it by using [desc].
     
    PB4FUN, Sep 16, 2003
    #5
    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?TGVlIEhvbHNlbmJlY2s=?=

    help please on insert statement into Access from webpage !

    =?Utf-8?B?TGVlIEhvbHNlbmJlY2s=?=, Mar 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    =?Utf-8?B?TGVlIEhvbHNlbmJlY2s=?=
    Mar 10, 2005
  2. Danny Shevitz
    Replies:
    2
    Views:
    209
    Peter Otten
    Jul 24, 2008
  3. Curt_C [MVP]

    access insert statement

    Curt_C [MVP], Aug 31, 2003, in forum: ASP General
    Replies:
    10
    Views:
    215
    middletree
    Sep 2, 2003
  4. J. Muenchbourg
    Replies:
    3
    Views:
    254
    Aaron Bertrand - MVP
    Sep 30, 2003
  5. Paul
    Replies:
    16
    Views:
    215
    Jayme Pechan
    Aug 31, 2005
Loading...

Share This Page