473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Microsoft VBScript compilation (0x800A0400): Expected statement

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 & "," _
& tohour & ");"

Jul 19 '05 #1
3 17081
Did you copy and paste that code? It shouldn't give that error. The next
line can start with a ', but all the lines that follow it with the _
character will be a continuation of the comment, not code.

Ray at home

"Matt" <ma*******@hotmail.com> wrote in message
news:uG**************@TK2MSFTNGP09.phx.gbl...
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 & "," _
& tohour & ");"


Jul 19 '05 #2
"Matt" wrote:
: 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 & "," _
: & tohour & ");"

It is an append to the next line.

good:
Response.Write("First line<br />" & vbCrLf & _
"Second line<br />" & vbCrLf)
result:
First line
Second line

bad:
Response.Write("First line<br />" & vbCrLf _
Response.Write("Second line<br /> & vbCrLf)
result:
Microsoft VBScript compilation error '800a03ee'
Expected ')'
Response.Write("Second line<br />" & vbCrLf)
--------------------------------------------^

This will give you an error because it says you need a closing ).
So, if you change it to this:
Response.Write("First line<br />" & vbCrLf _
Response.Write("Second line<br /> & vbCrLf))

You'll get an interesting result:
Second line
First line

If you're going to append lines, then it should follow as you would write it
on one line. Your SQL statement is not finished and you cannot put a
comment in the middle of it.

This also is incorrect.

sqlStmt = "insert into TimeSlot (WeekDay, BeginTime, EndTime) VALUES (" _
' & 2 & "," _
& beginhour & "," _
& tohour & ");"

The thing to do it comment out the whole statement and just use a new
statement with the part you want to remove.
'sqlStmt = "insert into TimeSlot (WeekDay, BeginTime, EndTime) VALUES (" _
' & 2 & "," _
' & beginhour & "," _
' & tohour & ");"

sqlStmt = "insert into TimeSlot (WeekDay, BeginTime, EndTime) VALUES (" _
& beginhour & "," _
& tohour & ");"

The only thing wrong now is you need to remove Weekday since you have 3
columns and only 2 values. (O:=
And, it should probably be more like this:

sqlStmt = "INSERT INTO TimeSlot(BeginTime, EndTime) VALUES(" _
& beginhour & ", " _
& tohour & ")"

If the values were strings '12PM' instead of numbers '12', then you'll want
quotes around the values:

sqlStmt = "INSERT INTO TimeSlot(BeginTime, EndTime) VALUES('" _
& beginhour & "', "' _
& tohour & "')"

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://support.microsoft.com/default...&ln=EN-US&FR=0
-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp

Jul 19 '05 #3
I think the issue here is that because the second line is commented, the
'_' continuation for the third line is not seen. It's just part of the
second line's comment!

-rwg

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

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 expected end of statement However, if I do 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 failing, what is going on?? All I have been able...
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 failing, what is going on?? All I have been able...
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 was/is: <%@LANGUAGE="VBCRIPT" CODEPAGE="1252"%>...
2
by: JNariss | last post by:
I keep getting the following error message when trying to preview my page: Microsoft VBScript compilation error '800a0400' Expected statement /TESTESC.asp, line 33
2
by: sonasiva | last post by:
{asp code} Error Type: Microsoft VBScript compilation (0x800A03EE) Expected ')' /web/company_ind.asp, line 35, column 37 Response.Write(objrs("investor_name")""<a...
11
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...
3
by: Indy | last post by:
Hi, I am new to VB and have some previous programming experiences. Curently working as an IT support person and trying to write a VB 6 script to access apos database and get one of the table's...
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 I have taken pieces and tried to edit for this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
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...
0
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...

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.