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
---------------------------------------------------------------------------------------------------------------------------------------------------^
8 3745
i can't seem to spot it in the code sample provided. Can you cut/paste the entire script?
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")
-
%>
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
Is your variable id supposed to be a string? You have it wrapped in apostrophes, so I am curious.
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.
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.
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.
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
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Matthew Louden |
last post by:
I have no idea what's wrong with the following ASP statement:
Response.Write "<select name=\"id\">"
MS VBScript Compilation error 800a0401
expected end of statement
However, if I do the...
|
by: Matt |
last post by:
When the ASP statement end with a _ character, then the next line cannot
have comment ' character. Is that correct? Since I encountered the following
error:
Microsoft VBScript compilation...
|
by: Adam Short |
last post by:
Can anyone help?
I have all of a sudden started to receive this error on my site!
I have no idea what script it is executing, why it is now failing, what is
going on??
All I have been able...
|
by: Adam Short |
last post by:
Can anyone help?
I have all of a sudden started to receive this error on my site!
I have no idea what script it is executing, why it is now failing, what is
going on??
All I have been able...
|
by: aklsdjfh |
last post by:
I'm no expert in asp and vbscript but not a total beginner. I've got some
VBScript in an asp page which is generating a forumla for use in Lotus Notes
replication.
The line that it is objecting...
|
by: JNariss |
last post by:
Hello,
I have created a connection to my Access database with Dreamweaver and
made a simple form with 4 fields.
The code behind this form was/is:
<%@LANGUAGE="VBCRIPT" CODEPAGE="1252"%>...
|
by: remya1000 |
last post by:
While running the program, i'm getting this error
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/admin/currentmonth.asp, line 26
strSQL = "SELECT...
|
by: char |
last post by:
I can't figure out why I am getting error: Microsoft VBScript compilation '800a0400'
SET MyRecordSet = SERVER.CREATEOBJECT("ADODB.RECORDSET")
MySQL = "SELECT * FROM ShipSummary (NOLOCK) where...
|
by: kevinr |
last post by:
Hi, I am brand new to VB, and I am trying to deploy Office 2007 on my network here at work. We used part of this script to do another deployment, and I have taken pieces and tried to edit for this...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |