P: 4
|
Can anyone help...?
I keep getting this error message and am now getting angry. I have checked my syntax hundreds of times and can not seem to find anything wrong with it....I think I need a fresh pair of eyes..please can someone help me.
I have copied the code below:
================================================== =
Expected end of statement
/admin/news_update_pro.asp, line 22
conn.Open "SET DateFormat dmy;update NewsItem set create_date='"&c_date&"', release_date='"&r_date&"', short_headline='"&s_headline&"', headline='"&headline&"', abstract='"&abstract&"', full_text='"&f_text&"' where id='"&id&"'",objConn,3,3
---------------------------------------------------------------------------------------------------------------------------------------------------^
| |
Share this Question
Expert 100+
P: 164
|
i can't seem to spot it in the code sample provided. Can you cut/paste the entire script?
| |
P: 4
|
Here is the entire code copied below:
Thanks -
<!--#include file="connection.asp"-->
-
-
<%
-
id=request.Form("id")
-
-
create=request.Form("c_date")
-
create_date=CDate(create)
-
-
release=request.form("r_date")
-
release_date=CDate(release)
-
-
short_headline=request.Form("s_headline")
-
headline=request.Form("headline")
-
abstract=request.Form("abstract")
-
full_text=request.Form("f_text")
-
-
set conn=Server.CreateObject("ADODB.Recordset")
-
-
''conn.Open "update NewsItem set create_date='"&c_date&"', release_date='"&r_date&"', short_headline='"&s_headline&"', headline='"&headline&"', abstract='"&abstract&"', full_text='"&f_text&"' where id='"&id&"'",objConn,3,3
-
-
-
conn.Open "SET DateFormat dmy;update NewsItem set create_date='"&c_date&"', release_date='"&r_date&"', short_headline='"&s_headline&"', headline='"&headline&"', abstract='"&abstract&"', full_text='"&f_text&"' where id='"&id&"'",objConn,3,3
-
-
// conn.Close()
-
set conn=nothing
-
-
Response.Redirect ("news_index.asp")
-
%>
| | Expert 2.5K+
P: 3,405
|
For troubleshooting purposes, dump this "SET dateFormat..." string into a variable, then print it out. When you call the conn.open line you can easily do this: - dim query
-
query = "SET DateFormat dmy" 'etc
-
-
response.write query 'this line can be commented out after everything works
-
-
conn.open query, objConn, 3,3
Let me know if this helps.
Jared
| | Expert 100+
P: 164
|
Is your variable id supposed to be a string? You have it wrapped in apostrophes, so I am curious.
| | Expert 100+
P: 164
|
That error is normally indicative of a misspelled, or non-existent field in your SQL query. Check to make sure that all the fields in your SQL statement are all correctly spelled and actually a part of the table your updating.
| |
P: 4
|
Is your variable id supposed to be a string? You have it wrapped in apostrophes, so I am curious.
Yes it is meant to be a string...It is the id number of the News item am entering into the database.
| |
P: 4
|
For troubleshooting purposes, dump this "SET dateFormat..." string into a variable, then print it out. When you call the conn.open line you can easily do this: - dim query
-
query = "SET DateFormat dmy" 'etc
-
-
response.write query 'this line can be commented out after everything works
-
-
conn.open query, objConn, 3,3
Let me know if this helps.
Jared
Hi Jared,
I tried that but it has not worked.
The problem seems to point to "headline" I am unsure why it stimbles here but not on the others.
| | Expert 2.5K+
P: 3,405
|
Hi Jared,
I tried that but it has not worked.
The problem seems to point to "headline" I am unsure why it stimbles here but not on the others.
show the query as it is written out in the response.write line
| | | | Question stats - viewed: 3278
- replies: 8
- date asked: Dec 10 '07
|