IN the code below, I am getting an Incorrect Syntax near "," error (the
sql execute line, and it is pointing to position 1 ) (the display
formatting here may look different than my script):
strSQLStatement = "INSERT INTO
tblArticles(handid,articleid,articleDate,sport,art icleheader,fpick,artic
leText)"_
& "VALUES ('" & handid & "', " _
& articleid & ", '" _
& articledate & "', " _
& sport & ", '" _
& articleheader & "', '" _
& fpick & "', '" _
& articleText & "')"
response.write strSQLstatement
Conn.Execute(strSQLStatement)
????
Thanks in advance
Muench
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! 5 45055
One of your values is empty. What does the response.write line show (seeing
your SQL statement prior to variable substitution is quite useless).
"J. Muenchbourg" <jo*****@canada.com> wrote in message
news:#u**************@tk2msftngp13.phx.gbl...
IN the code below, I am getting an Incorrect Syntax near "," error (the sql execute line, and it is pointing to position 1 ) (the display formatting here may look different than my script):
strSQLStatement = "INSERT INTO tblArticles(handid,articleid,articleDate,sport,art icleheader,fpick,artic leText)"_ & "VALUES ('" & handid & "', " _ & articleid & ", '" _ & articledate & "', " _ & sport & ", '" _ & articleheader & "', '" _ & fpick & "', '" _ & articleText & "')" response.write strSQLstatement Conn.Execute(strSQLStatement)
???? Thanks in advance Muench
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
show us the Response.Write of that statement, also which are string, which
are int
--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"J. Muenchbourg" <jo*****@canada.com> wrote in message
news:#u**************@tk2msftngp13.phx.gbl...
IN the code below, I am getting an Incorrect Syntax near "," error (the sql execute line, and it is pointing to position 1 ) (the display formatting here may look different than my script):
strSQLStatement = "INSERT INTO tblArticles(handid,articleid,articleDate,sport,art icleheader,fpick,artic leText)"_ & "VALUES ('" & handid & "', " _ & articleid & ", '" _ & articledate & "', " _ & sport & ", '" _ & articleheader & "', '" _ & fpick & "', '" _ & articleText & "')" response.write strSQLstatement Conn.Execute(strSQLStatement)
???? Thanks in advance Muench
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
What Aaron says is best, but I would add that there is a possibility that
you have a comma(or some other kind of show-stopper) in one of your values.
Bottom line is to do a response.write
"J. Muenchbourg" <jo*****@canada.com> wrote in message
news:#u**************@tk2msftngp13.phx.gbl...
IN the code below, I am getting an Incorrect Syntax near "," error (the sql execute line, and it is pointing to position 1 ) (the display formatting here may look different than my script):
strSQLStatement = "INSERT INTO tblArticles(handid,articleid,articleDate,sport,art icleheader,fpick,artic leText)"_ & "VALUES ('" & handid & "', " _ & articleid & ", '" _ & articledate & "', " _ & sport & ", '" _ & articleheader & "', '" _ & fpick & "', '" _ & articleText & "')" response.write strSQLstatement Conn.Execute(strSQLStatement)
???? Thanks in advance Muench
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
It wouldn't hurt to throw some spaces in, I don't think T-SQL cares, but you
have no spaces after your table name or after your closing brace on the
column list.
After you resolve your SQL Problem, I believe this will cause a problem
Conn.Execute(strSQLStatement)
Execute is a function, but since you aren't doing anything with the return
value, you should call it as though it were a subroutine
Conn.Execute strSQLStatement
"J. Muenchbourg" <jo*****@canada.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
IN the code below, I am getting an Incorrect Syntax near "," error (the sql execute line, and it is pointing to position 1 ) (the display formatting here may look different than my script):
strSQLStatement = "INSERT INTO tblArticles(handid,articleid,articleDate,sport,art icleheader,fpick,artic leText)"_ & "VALUES ('" & handid & "', " _ & articleid & ", '" _ & articledate & "', " _ & sport & ", '" _ & articleheader & "', '" _ & fpick & "', '" _ & articleText & "')" response.write strSQLstatement Conn.Execute(strSQLStatement)
???? Thanks in advance Muench
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
Tom B wrote: It wouldn't hurt to throw some spaces in, I don't think T-SQL cares, but you have no spaces after your table name or after your closing brace on the column list.
After you resolve your SQL Problem, I believe this will cause a problem Conn.Execute(strSQLStatement)
Execute is a function, but since you aren't doing anything with the return value, you should call it as though it were a subroutine
Conn.Execute strSQLStatement
You should also tell ADO what type of command you are executing, and that
you do not want it to construct a recordset:
Conn.Execute strSQLStatement,,129
129 is the addition of two constants: adCmdText and adExecuteNoRecords. If
you have the ADO constants defined, you can do this instead:
Conn.Execute strSQLStatement,,adCmdText + adExecuteNoRecords
HTH,
Bob Barrows This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeff Magouirk |
last post by:
Dear Group,
I am trying to create a view and keep getting the Incorrect syntax near the
keyword 'Declare'" error.
Here is the code I am writing.
Create view fixed_airs (sid, fad_a2, fad_a3)...
|
by: Michael |
last post by:
Hi Everyone,
I'm having a slight problem, I hope I didn't overlook something. I'm getting
the following error when I try to execute the function below:
Incorrect syntax near 'intake_GetListSet'."...
|
by: Sandesh |
last post by:
Hello All,
Me saying " has any body come across such error would be
underestimating".
Well I am getting a very peculiar and unique error "Line 1: Incorrect
syntax near 'Actions'."
...
|
by: iporter |
last post by:
In the following code, the two Response.Write statements output exactly
the same - I can copy and paste both into Query Analyzer, and run them
fine. However, if I comment out line 3, the...
|
by: wallic |
last post by:
Hello,
This is my first post and I am a beginner with SQL code. The code below is supposed to update a new table (loctable) with a calculated value based on the original table (hra_data). ...
|
by: roamnet |
last post by:
hi
i created database file with .mdf extention ,sql server as a source
and use grid view to display data
there're no problem in data retrieve and display,but i want to edit it
or insert new...
|
by: itamar82 |
last post by:
I am getting the following error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'WHERE'.
for the sql below:
SELECT TourId
FROM
(SELECT...
|
by: arial |
last post by:
Hi,
I am getting this error message:
Incorrect syntax near the keyword 'where'.
Description: An unhandled exception occurred during the execution of the current web request. Please review...
|
by: karenkksh |
last post by:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |