Link to home
Start Free TrialLog in
Avatar of RonNeiger
RonNeiger

asked on

Microsoft VBScript compilation error '800a0400' Expected statement

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
%>
Avatar of peh803
peh803
Flag of United States of America image

What line is the error occurring on?
ASKER CERTIFIED SOLUTION
Avatar of peh803
peh803
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RonNeiger
RonNeiger

ASKER

/autoFollowup.asp, line 62

WEND
You Rock!!

Thanks
Always glad to help!

peh803