472,337 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,337 software developers and data experts.

Microsoft VBScript compilation error '800a0401'

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
---------------------------------------------------------------------------------------------------------------------------------------------------^
Dec 10 '07 #1
8 3681
Nicodemas
164 Expert 100+
i can't seem to spot it in the code sample provided. Can you cut/paste the entire script?
Dec 11 '07 #2
Here is the entire code copied below:
Thanks
Expand|Select|Wrap|Line Numbers
  1. <!--#include file="connection.asp"-->
  2.  
  3. <%     
  4.     id=request.Form("id") 
  5.  
  6.     create=request.Form("c_date")
  7.     create_date=CDate(create) 
  8.  
  9.     release=request.form("r_date")
  10.     release_date=CDate(release) 
  11.  
  12.     short_headline=request.Form("s_headline") 
  13.     headline=request.Form("headline") 
  14.     abstract=request.Form("abstract") 
  15.     full_text=request.Form("f_text") 
  16.  
  17.     set conn=Server.CreateObject("ADODB.Recordset")   
  18.  
  19.     ''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
  20.  
  21.  
  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
  23.  
  24. //   conn.Close()
  25.    set conn=nothing
  26.  
  27.     Response.Redirect ("news_index.asp")
  28. %>
Dec 11 '07 #3
jhardman
3,406 Expert 2GB
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:
Expand|Select|Wrap|Line Numbers
  1. dim query
  2. query = "SET DateFormat dmy" 'etc
  3.  
  4. response.write query 'this line can be commented out after everything works
  5.  
  6. conn.open query, objConn, 3,3
Let me know if this helps.

Jared
Dec 12 '07 #4
Nicodemas
164 Expert 100+
Is your variable id supposed to be a string? You have it wrapped in apostrophes, so I am curious.
Dec 13 '07 #5
Nicodemas
164 Expert 100+
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.
Dec 14 '07 #6
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.
Dec 17 '07 #7
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:
Expand|Select|Wrap|Line Numbers
  1. dim query
  2. query = "SET DateFormat dmy" 'etc
  3.  
  4. response.write query 'this line can be commented out after everything works
  5.  
  6. 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.
Dec 17 '07 #8
jhardman
3,406 Expert 2GB
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
Dec 17 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
3
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...
3
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...
6
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...
1
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...
1
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...
11
by: remya1000 | last post by:
While running the program, i'm getting this error Microsoft VBScript compilation error '800a0401' Expected end of statement ...
5
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")...
2
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...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.