473,698 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft VBScript compilation error '800a0401'

4 New Member
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='"&hea dline&"', abstract='"&abs tract&"', full_text='"&f_ text&"' where id='"&id&"'",ob jConn,3,3
---------------------------------------------------------------------------------------------------------------------------------------------------^
Dec 10 '07 #1
8 3759
Nicodemas
164 Recognized Expert New Member
i can't seem to spot it in the code sample provided. Can you cut/paste the entire script?
Dec 11 '07 #2
Charmie1701
4 New Member
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 Recognized Expert Specialist
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 Recognized Expert New Member
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 Recognized Expert New Member
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
Charmie1701
4 New Member
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
Charmie1701
4 New Member
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 Recognized Expert Specialist
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
8145
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 following, it will be fine: <select name="id">
3
17113
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 (0x800A0400) Expected statement sqlStmt = "insert into TimeSlot (WeekDay, BeginTime, EndTime) VALUES (" _ ' & 2 & "," _ & beginhour & "," _
3
4669
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 to find out is that Microsoft has had the same problem on their site!
6
3802
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 to find out is that Microsoft has had the same problem on their site!
1
7532
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 to is <% if user2 <> "" then response.write("| @IsMember(&quot;" & LCase(user2) & "&quot;;@LowerCase(@Name(;AssignedTo)))") end if %> i.e. if the string user2 is "Mike" I expect the HTML to be |...
1
4220
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"%> <!--#include virtual="/Connections/EmployeeStatusChange.asp" --> <%
11
18650
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 RFCInfo.Name, RFCInfo.Date, RFCInfo.RFCNo, RFCInfo.InvNo, RFCInfo.Deleted, InvoiceDetail.Quantity, InvoiceDetail.Description, InvoiceDetail.ExtendedPrice, InvoiceInfo.GST, InvoiceInfo.PST, InvoiceInfo.Total FROM RFCInfo INNER JOIN (InvoiceDetail INNER JOIN...
5
2848
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 ShipDate = DateDiff(d, 0, GetDate()+1)" MyRecordSet.OPEN MySQL, XXXXXX if not MyRecordSet.eof then MyArray = MyRecordSet.GETROWS() MyRecordSet.CLOSE FOR MyCursor = LBOUND(MyArray,2) TO UBOUND(MyArray,2)
2
4993
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 deployment. I know I am probably way off the mark, but I would appreciate any help. This is the initial error I receive when running the script. C:\bkuptestpc\kr_migrate.vbs(276, 1) Microsoft VBScript compilation error: Expected 'End' Exit code: 1 ,...
0
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7732
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.