Solved

Microsoft VBScript compilation  error '800a0400' Expected statement

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JQuery Date Time picker not showing 29 129
Use a variable for Class Name in Classic ASP 4 54
Generate report pulling data (links) from three tables 31 64
Error viewing ASP page 12 162
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

815 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

12 Experts available now in Live!

Get 1:1 Help Now