Solved

Microsoft VBScript compilation  error '800a0400' Expected statement

Posted on 2004-10-06
5
4,749 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 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

15 Experts available now in Live!

Get 1:1 Help Now