Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > INvalid syntax

Reply
Thread Tools

INvalid syntax

 
 
J. Muenchbourg
Guest
Posts: n/a
 
      09-19-2003
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!
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      09-19-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      09-19-2003
> 'articleid' is a primary key.

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


 
Reply With Quote
 
Tom B
Guest
Posts: n/a
 
      09-19-2003
is sport a number field?
is articleid an Identity field?



"J. Muenchbourg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
J. Muenchbourg
Guest
Posts: n/a
 
      09-19-2003


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!
 
Reply With Quote
 
Tom B
Guest
Posts: n/a
 
      09-19-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> 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!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid character in base-64 string and invalid postback or callba kevin ASP .Net 0 01-16-2008 09:39 PM
How do fix: "Wrong number of arguments" / "invalid propert assignment"/ "Invalid argument" Java Guy Javascript 1 10-15-2006 08:41 PM
How do fix: "Wrong number of arguments" / "invalid propert assignment"/ "Invalid argument" Java Guy Java 1 10-15-2006 08:31 PM
Invalid URI: There is an invalid sequence in the string. Error!! Patrick.O.Ige ASP .Net 1 07-02-2006 11:21 AM
invalid@invalid.org Hank Sniadoch Computer Information 1 08-20-2004 11:24 AM



Advertisments