Solved

Microsoft VBScript compilation  error '800a0400' Expected statement

Posted on 2004-10-06
5
4,814 Views
Last Modified: 2009-07-29
Getting this error--

Microsoft VBScript compilation  error '800a0400' Expected statement

I know this is just a stupid  syntax error but I can not find it  and am facing a time crunch.

Thanks in advance  experts!



<%
Dim rstTicket
Dim rstTicket_numRows
dateOpened = Now
category = 5
created = 1630
owner = 1630
web=1
nowDate = Now
stat = "Open"
priority = 0
Set rstTicket = Server.CreateObject("ADODB.Recordset")
rstTicket.ActiveConnection = MM_CL2Main_STRING
rstTicket.Source = "SELECT followUpFlag, followUpDate  FROM dbo.Ticket"
rstTicket.CursorType = 2
rstTicket.CursorLocation = 2
rstTicket.LockType = 1
rstTicket.Open()

rstTicket_numRows = 0
flag = rstTicket("followUpFlag")
nDate = rstTicket("followUpDate")

While Not rstTicket.BOF OR rstTicket.EOF
IF flag = 1 AND nDate = Now THEN
nextFollowUp = dateAdd("D",14,Now)
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_CL2Main_STRING
Command1.CommandText = "INSERT INTO dbo.Ticket (ticketID, dateOpened, lastUpdated, createdBy, currentOwner, issue, webFlag, status, category, merchantFK, followUpFlag, followUpDate, priority)  VALUES ( NewID(),'" &nowDate& "','" &nowDate& "','" &created& "','" &owner& "','" &issue& "','" &web& "','" &stat& "','" &category& "','" &merchant& "', 2 ,'" &nextFollowUp& "','" &priority & "')"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()


ELSE IF flag =2 AND nDate = NOW THEN
nextFollowUp = dateAdd("D",30,Now)
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_CL2Main_STRING
Command1.CommandText = "INSERT INTO dbo.Ticket (ticketID, dateOpened, lastUpdated, createdBy, currentOwner, issue, webFlag, status, category, merchantFK, followUpFlag, followUpDate, priority)  VALUES ( NewID(),'" &nowDate& "','" &nowDate& "','" &created& "','" &owner& "','" &issue& "','" &web& "','" &stat& "','" &category& "','" &merchant& "', 3 ,'" &nextFollowUp& "','" &priority & "')"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

ELSE IF  flag = 3 AND nDate = NOW THEN
nextFollowUp = dateAdd("D",90,Now)
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_CL2Main_STRING
Command1.CommandText = "INSERT INTO dbo.Ticket (ticketID, dateOpened, lastUpdated, createdBy, currentOwner, issue, webFlag, status, category, merchantFK, followUpFlag, followUpDate, priority)  VALUES ( NewID(),'" &nowDate& "','" &nowDate& "','" &created& "','" &owner& "','" &issue& "','" &web& "','" &stat& "','" &category& "','" &merchant& "', 1 ,'" &nextFollowUp& "','" &priority & "')"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

END IF
rstTicket.MoveNext
WEND
%>
<%
rstTicket.Close()
Set rstTicket = Nothing
%>
0
Comment
Question by:RonNeiger
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:peh803
ID: 12240674
What line is the error occurring on?
0
 
LVL 19

Accepted Solution

by:
peh803 earned 500 total points
ID: 12240695
change your ELSE IF statements to ELSEIF (no space)

peh803
0
 

Author Comment

by:RonNeiger
ID: 12240700
/autoFollowup.asp, line 62

WEND
0
 

Author Comment

by:RonNeiger
ID: 12240747
You Rock!!

Thanks
0
 
LVL 19

Expert Comment

by:peh803
ID: 12240825
Always glad to help!

peh803
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Use a variable for Class Name in Classic ASP 4 61
PDF Embed pdfobject.js local path problem regular ASP 2 181
Select distinct 25 116
Pass through dll 2 91
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question