Ask a Question related to ASP, Design and Development.

  1. #1

    Default INvalid syntax

    an Incorrect syntax near ','. (Line 1) is what I'm getting with this
    insert statement, the error pointing to the sql execute:

    "INSERT INTO
    tblArticles(articleid,articleDate,sport,articlehea der,fpick,articleText)
    "_
    & "VALUES (" & articleid & ", '" _
    & articledate & "', " _
    & sport & ", '" _
    & articleheader & "', '" _
    & fpick & "', '" _
    & articleText & "')"

    'articleid' is a primary key.

    ???
    Muench

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    J. Muenchbourg Guest

  2. Similar Questions and Discussions

    1. syntax Error: invalid quantifier
      syntax Error: invalid quantifier
    2. If than syntax help please
      I'm trying to say: If price2 equals the selected price than apply the style bold price. If price 2 is nothing or zero than show nothing. If price...
    3. Need Help With Syntax!
      > <td bgcolor="#FFFFFF" width="10"> Why do you need the double quotes to appear??? Double-quotes around attribute values are useless, imho,...
    4. Syntax
      Hi, In a subclass, is sub new() end sub the same as sub new()
    5. Help with DB2 Syntax.
      Hi Everyone, Recently our comany upgraded their applications from MS ACCESS 2000 to DB2 version 7.2 UDB. I'm not as skilled in DB2 with the...
  3. #2

    Default Re: INvalid syntax

    s = "INSERT INTO
    tblArticles(articleid,articleDate,sport,articlehea der,fpick,articleText)
    "_
    & "VALUES (" & articleid & ", '" _
    & articledate & "', " _
    & sport & ", '" _
    & articleheader & "', '" _
    & fpick & "', '" _
    & articleText & "')"


    RESPONSE.WRITE S
    RESPONSE.END

    What does that produce?

    Ray at work

    "J. Muenchbourg" <jodaddy@canada.com> wrote in message
    news:OuKs65sfDHA.2364@TK2MSFTNGP09.phx.gbl...
    > an Incorrect syntax near ','. (Line 1) is what I'm getting with this
    > insert statement, the error pointing to the sql execute:
    >
    > "INSERT INTO
    > tblArticles(articleid,articleDate,sport,articlehea der,fpick,articleText)
    > "_
    > & "VALUES (" & articleid & ", '" _
    > & articledate & "', " _
    > & sport & ", '" _
    > & articleheader & "', '" _
    > & fpick & "', '" _
    > & articleText & "')"
    >
    > 'articleid' is a primary key.
    >
    > ???
    > Muench
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Ray at Guest

  4. #3

    Default Re: INvalid syntax

    > 'articleid' is a primary key.

    So how are you populating this? Where does articleid get generated?


    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: INvalid syntax

    is sport a number field?
    is articleid an Identity field?



    "J. Muenchbourg" <jodaddy@canada.com> wrote in message
    news:OuKs65sfDHA.2364@TK2MSFTNGP09.phx.gbl...
    > an Incorrect syntax near ','. (Line 1) is what I'm getting with this
    > insert statement, the error pointing to the sql execute:
    >
    > "INSERT INTO
    > tblArticles(articleid,articleDate,sport,articlehea der,fpick,articleText)
    > "_
    > & "VALUES (" & articleid & ", '" _
    > & articledate & "', " _
    > & sport & ", '" _
    > & articleheader & "', '" _
    > & fpick & "', '" _
    > & articleText & "')"
    >
    > 'articleid' is a primary key.
    >
    > ???
    > Muench
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Tom B Guest

  6. #5

    Default Re: INvalid syntax



    dim sqlid
    sqlid = "SELECT max articleid from tblarticles"
    Set rsid = Server.CreateObject("ADODB.Recordset")
    rsid.Open sqlid,sqlc,3

    articleid = rsid("articleid")
    rsid.Close
    set rsid = nothing


    in response to Tom's question about 'sport', yes it is an integer
    datatype

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    J. Muenchbourg Guest

  7. #6

    Default Re: INvalid syntax

    Aaron asked how you CREATED the articleid, is it an Identity(SQL Server) or
    Autonumber(Access)
    if it is, then you can't insert a value, which you are doing in your insert
    statement.
    If it's not an Identity/Autonumber, are you ensuring it's unique? You said
    it was a Primary Key, so it has to be unique.



    "J. Muenchbourg" <jodaddy@canada.com> wrote in message
    news:OmBIA3tfDHA.1872@TK2MSFTNGP09.phx.gbl...
    >
    >
    > dim sqlid
    > sqlid = "SELECT max articleid from tblarticles"
    > Set rsid = Server.CreateObject("ADODB.Recordset")
    > rsid.Open sqlid,sqlc,3
    >
    > articleid = rsid("articleid")
    > rsid.Close
    > set rsid = nothing
    >
    >
    > in response to Tom's question about 'sport', yes it is an integer
    > datatype
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Tom B Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139