469,360 Members | 1,799 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
5 1529
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" <jo*****@canada.com> wrote in message
news:Ou**************@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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
> 'articleid' is a primary key.

So how are you populating this? Where does articleid get generated?
Jul 19 '05 #3
is sport a number field?
is articleid an Identity field?

"J. Muenchbourg" <jo*****@canada.com> wrote in message
news:Ou**************@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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4


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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5
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" <jo*****@canada.com> wrote in message
news:Om**************@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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by ray sleeper | last post: by
4 posts views Thread by Bradley Kite | last post: by
reply views Thread by Mark Phanides | last post: by
5 posts views Thread by DIBS | last post: by
2 posts views Thread by py | last post: by
10 posts views Thread by ronrsr | last post: by
7 posts views Thread by alf | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.