Solved

Microsoft VBScript compilation  error '800a0400' Expected statement

Posted on 2004-10-06
5
4,706 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
Comment Utility
What line is the error occurring on?
0
 
LVL 19

Accepted Solution

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

peh803
0
 

Author Comment

by:RonNeiger
Comment Utility
/autoFollowup.asp, line 62

WEND
0
 

Author Comment

by:RonNeiger
Comment Utility
You Rock!!

Thanks
0
 
LVL 19

Expert Comment

by:peh803
Comment Utility
Always glad to help!

peh803
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now