Microsoft VBScript compilation error '800a0400'

when i load my page i get this error:

Microsoft VBScript compilation error '800a0400'

Expected statement

/toc.asp, line 170

Option Explicit
^

and here is the code for my page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>TEEN WRITING NET</title>
<meta http-equiv="Content-Type" content="text/css; charset=iso-8859-1">
<meta name="description" content="The newest teen writing site and contest.">
<meta name="keywords" content="keyword, keyword, keyword, keyword, keyword, keyword, keyword phrase, keyword phrase, keyword phrase, keyword phrase">
<meta name="copyright" content="2002 Teenwriting.net.  All rights reserved.  Duplication of any content on this site is prohibited.">
<meta name="design by" content="Teenwriting.net">
<meta name="robots" content="all">
<meta name="revisit-after" content="7 days">
<meta name="distribution" content="global">
<meta name="document-classification" content="General">
<meta name="rating" content="general">
<meta name="language" content="EN">

<script language="JavaScript">
function doClock(){
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="1";
  var month=new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
  var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}
</script>


<link rel="stylesheet" href="http://www.teenwriting.net/btstyle19.css" type="text/css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><FONT face=Verdana>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#a4a09f">
  <tr valign="center" align="middle">
    <td colspan="6" class="bthead" height="2">
      <div align="left"><A href="#"><FONT face=Verdana>
        <IMG height=90 alt="REPLACE WITH MEANINGFUL IMAGE DESCRIPTION" src  ="http://teenwriting.net/header.jpg" width=750 border=0 ></FONT></A></div>
    </td>
  </tr>
  <tr valign="center" align="middle">
    <td width="16%" class="btnav" height="20">
      <div align="center"><a href="http://poetry.teenwriting.net"><FONT
      face=Verdana>Poetry</FONT></a></div>
    </td>
    <td class="btnav" height="20" width="16%">
      <div align="center"><a href="http://songs.teenwriting.net"><FONT
      face=Verdana>Songs</FONT></a></div>
    </td>
    <td class="btnav" height="20" width="15%">
      <div align="center"><A href="http://stories.teenwriting.net"><FONT face=Verdana>Stories</FONT></A></div>
    </td>
    <td class="btnav" height="20" width="17%">
      <div align="center"><A href="http://essay.teenwriting.net"><FONT face=Verdana>Essay</FONT></A></div>
    </td>
    <td class="btnav" height="20" width="17%">
      <div align="center"><A href="http://fiction.teenwriting.net"><FONT face=Verdana>Fiction</FONT></A></div>
    </td>
    <td width="19%" class="btnav" height="20">
      <div align="center"><A href="http://fanfic.teenwriting.net"><FONT
  face=Verdana>Fan Fiction</FONT></A></div>
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <TBODY>
  <tr>
    <td valign="top" height="514">
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
          <td class="btnavbk" height="98"><FONT
            face=Verdana>&nbsp;</FONT></td>
          <td class="btnavbk" valign="center" height="98">
            <table width="99%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center">
              <tr>
                <td height="2" bgcolor="#a4a09f">
                  <div align="center"> <b><FONT face=Verdana>Current
                  News</FONT> </b></div>
                </td>
              </tr>
              <tr>
                <td class="btnavbk" valign="top" height="67">
                  <table width="100%" border="0" cellspacing="0" cellpadding="8">
                    <tr>
                      <td bgcolor="#ffffff" valign="top" height="54">
                        <p><FONT face=Verdana>Hi every one! Welcome to the new spot for teen writngs. We are still currently
                                    hard at work trying ot get this awesome and fun site up and running! Check back often cause we will
                                    be offering tons of cool things for everyone to do.  You'll be able to post your work and read and
                                    critique other teens writings and enjoy contest as well! If you have any ideas or suggestions please
                                    feel free to email us at: <A href="mailto:suggestions@teenwriting.net">suggestions</A>! Thanks again
                                    for looking. Please check back soon!
                    </FONT>  
 </p>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
     
        <table width="100%" border="0" cellspacing="0" cellpadding="8">
        <TBODY>
        <tr>
          <td valign="top" class="btnavbk" width="20%" height="433">
            <p align="center"><FONT face=Verdana><FONT>
            <TABLE borderColor=#000000 cellSpacing=0 cellPadding=8 width="100%"
            border=1>          <p align="center"><FONT face=Verdana><FONT><IMG height=1 src="images/clear.gif" width=160><br>
              <b>
              <script language="JavaScript">
   document.write(doClock("M0","%20","D0",",%20","Y0"));
</script>
              </b></FONT>
<!--#include file = "menu.xhtml"-->
            <br>
            <table width="100%" border="1" cellspacing="0" cellpadding="8" bordercolor="#000000">
              <tr>
                <td bgcolor="#ffffff" valign="top" height="254">
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="btnavbk">
                        <div align="center"><FONT
                        face=Verdana>Coming Events </FONT>  </div>
                      </td>
                    </tr>
                    <tr>
                      <td><FONT face=Verdana>We will be up and running very shortly now! We are hard at work
                                and working with local companies to bring you some really new and cool things! If you have any
                                questions or comments please <A href="mailto:suggestions@teenwriting.net">email us</A>!
                  </FONT>  
                   
                               </td>
                    </tr>
                  </table>
                 
                </td>
              </tr>
            </table>
            <p><FONT face=Verdana>
            <TABLE borderColor=#000000 cellSpacing=0 cellPadding=8 width="100%"
            border=1>
             
              <TR>
                <TD vAlign=top width=75 bgColor=#ffffff height=84>
                  <P><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR></P></TD>
                <TD vAlign=top width=75 bgColor=#ffffff height=84><A
                  href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT> </A><BR><A href="#"><FONT
                  face=Verdana>Your Link</FONT>
            </A><BR></TD></TR></TABLE></FONT></p>
          </td>
          <td valign="top" width="64%" height="433">
            <p><br><FONT
            face=Verdana>
          <p>
             <!--#include file = "header.xhtml"--><br>
            <%
Option Explicit
Dim varPageName
Dim varAuthorID
Dim varLoadTOC

varPageName = "TOC"
varAuthorID = Request("AuthorAliasID")
varLoadTOC = True
%>
<!--#include file = "security.inc"-->
<!--#include file = "ensureconnection.inc"-->
<!--#include file = "checkstatus.inc"-->
<!--#include file = "preferences.inc"-->
<!--#include file = "stringreplace.inc"-->
<%

Dim varAlias,varDiaryType,varDiaryTitle,varDiaryDescription
varDiaryDescription = Empty
Set comm = Server.CreateObject("ADODB.Command")
Set rs = Server.CreateObject("ADODB.Recordset")
comm.ActiveConnection = conn
comm.CommandType = 4
comm.CommandText = "DM_SP_SelectDiaryDescription"
comm.Execute, Request("AuthorAliasID")
rs.Open comm
If ((rs.EOF = False) And (rs.BOF = False)) Then
 varAlias = rs.Fields("Alias")
 varDiaryType = rs.Fields("DiaryType")
 varDiaryTitle = rs.Fields("DiaryTitle")
 varDiaryDescription = Replace(("" & rs.Fields("DiaryDescription") & ""),vbcrlf,"<BR>" & vbcrlf)
 If (Session("Javascript") = "None") Then
  varDiaryDescription = ReplaceSens(varDiaryDescription,"<script","<xxxxxx",1)
  varDiaryDescription = ReplaceSens(varDiaryDescription,"language=","xxxxxxxxx",1)
 End If
 If (Session("AllowMusic") = "None") Then
  varDiaryDescription = ReplaceSens(varDiaryDescription,"<bgsound","<xxxxxxx",1)
  varDiaryDescription = ReplaceSens(varDiaryDescription,"<embed","<xxxxx",1)
 End If
 If (Session("BackgroundImages") = "None") Then
  varDiaryDescription = ReplaceSens(varDiaryDescription,"background:","xxxxxxxxxx:",1)
  varDiaryDescription = ReplaceSens(varDiaryDescription,"background=","xxxxxxxxxx=",1)
  varDiaryDescription = ReplaceSens(varDiaryDescription,"background-","xxxxxxxxxx-",1)
 End If
 If (Session("ImagesTOC") = "None") Then
  varDiaryDescription = ReplaceSens(varDiaryDescription,"<img ","<xxx",1)
 ElseIf ((Session("ImagesTOC") = "Friends") And (varMyFriend <> "Friend")) Then
  varDiaryDescription = ReplaceSens(varDiaryDescription,"<img","<xxx",1)      
 End If
End If
rs.Close
Set rs = Nothing
Set comm = Nothing
%><html>
 <head>
   <!--#include file = "stylesheet.inc"-->
  <TITLE>
   Welcome to <%=varAlias%>'s Diary<%If (Session("AuthorAlias") <> "") Then Response.Write(", " & Session("AuthorAlias"))%>
  </TITLE>
<%  
If (varStatus = "Author") Then
 Response.Write("<SCRIPT LANGUAGE=" & """" & "JavaScript" & """" & ">" & vbcrlf)
 Response.Write(" <!--" & vbcrlf)
 Response.Write("  function confirm_delete(){" & vbcrlf)
 Response.Write("   var password = prompt(" & """" & "To delete your diary, please enter your password and click OK" & """" & "," & """" & """" & ");" & vbcrlf)
 Response.Write("   if (password != " & """" & """" & " && password != null){" & vbcrlf)
 Response.Write("    document.write(" & """" & "<FORM NAME=DeleteDiary METHOD=Post ACTION=deletediary.asp>" & """" & ");" & vbcrlf)
 Response.Write("    document.write(" & """" & "<INPUT NAME=Password TYPE=Hidden MAXLENGTH=10 VALUE=" & """" & " + password + " & """" & ">" & """" & ");" & vbcrlf)
 Response.Write("    document.write(" & """" & "</FORM>" & """" & ")" & vbcrlf)
 Response.Write("    document.DeleteDiary.submit();" & vbcrlf)
 Response.Write("   }" & vbcrlf)
 Response.Write("  }" & vbcrlf)
 Response.Write(" -->" & vbcrlf)
 Response.Write("</SCRIPT>" & vbcrlf)
End If
%>  
 

    <TD VALIGN="Top" ALIGN="Center" COLSPAN="1" NAME="RightMenu" ID="RightMenu" WIDTH="25%" CLASS="MenuRight">
     <TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="1" >
<%
If (varIsIgnore = True) Then
 Response.Write("<TR><TD>")
 Response.Write("Sorry, but " & varAlias & " is ignoring you")
 Response.Write("</TD></TR>")
 varLoadTOC = False
ElseIf (varMyIgnore = True) Then
 Response.Write("<TR><TD>")
 Response.Write("You are ignoring " & varAlias)
 Response.Write("</TD></TR>")
 varLoadTOC = False
ElseIf ((varDiaryType = "Private") And (varStatus <> "Author")) Then
 Response.Write("<TR><TD>")
 Response.Write("Sorry, only " & varAlias & " can read this diary")
 Response.Write("</TD></TR>")
 varLoadTOC = False
ElseIf ((varDiaryType = "Friends") And (varStatus <> "Friend") And (varStatus <> "Author")) Then
 Response.Write("<TR><TD>")
 Response.Write("Sorry, only people on " & varAlias & "'s friends list can read this diary")
 Response.Write("</TD></TR>")
 varLoadTOC = False
ElseIf ((varDiaryType = "Signed") And (varStatus = "Unsigned")) Then
 Response.Write("<TR><TD>")
 Response.Write("Sorry, but " & varAlias & " only allows people who are logged in to read this diary")
 Response.Write("</TD></TR>")
 varLoadTOC = False
ElseIf (varStatus = "Invisible") Then
 If (Request.ServerVariables("HTTP_REFERER") <> "") Then
  Response.Redirect(Request.ServerVariables("HTTP_REFERER"))
 Else
  Response.Redirect("/")
 End If
End If

If (varLoadTOC = True) Then
 ReDim params(2)
 params(1) = Request("AuthorAliasID")
 params(0) = int(Session("AuthorAliasID"))
 params(2) = int(Request("Limit"))
 Set comm = Server.CreateObject("ADODB.Command")
 Set rs = Server.CreateObject("ADODB.Recordset")
 comm.ActiveConnection = conn
 comm.CommandType = 4
 comm.CommandText = "DM_SP_SelectTOC"
 comm.Execute , params
 Set params(2) = Nothing
 Set params(1) = Nothing
 Set params(0) = Nothing
 rs.Open comm
 If ((rs.EOF = False) And (rs.BOF = False)) Then
  Do While Not rs.EOF
  Response.Write("<TR><TD>")
  Response.Write("<SPAN CLASS=" & """" & "TOC" & """" & ">")
  Response.Write(" <SMALL>(")
  Response.Write(rs.Fields("Number"))
  Response.Write(")</SMALL>")
  Response.Write("</TD><TD>")
  Response.Write("<A HREF=" & """" & "entry.asp?EntryID=")
  Response.Write(rs.Fields("EntryID"))
  Response.Write("""" & ">")
  If (rs.Fields("EntryType") = "Private") Then
   Response.Write("<B>P</B> - ")
  ElseIf (rs.Fields("EntryType") = "Friends") Then
   Response.Write("<B>F</B> - ")
  End If
  If (rs.Fields("Title") <> "") Then
   Response.Write(rs.Fields("Title"))
  Else
   Response.Write(rs.Fields("EntryID"))
  End If
  Response.Write("</A>")
  Response.Write("</TD><TD>")
  Response.Write("<SPAN CLASS=" & """" & "TOC" & """" & ">")
  Response.Write(" <SMALL>")
  Response.Write(FormatDateTime(rs.Fields("AuthorDateCreated"),2))
  Response.Write("</SMALL>")
  Response.Write("<BR>")
  Response.Write("</TD></TR>")
  rs.MoveNext
  Loop
 End If
 rs.Close
 Set rs = Nothing
 Set comm = Nothing
 
 Response.Write("<TR><TD COLSPAN=" & """" & "3" & """" & ">")
 
 Set comm = Server.CreateObject("ADODB.Command")
 Set rs = Server.CreateObject("ADODB.Recordset")
 Dim intIndex
 comm.ActiveConnection = conn
 comm.CommandType = 4
 comm.CommandText = "DM_SP_SelectCountEntries"
 comm.Parameters.Append comm.CreateParameter ("@varAliasID",3,1,3,Request("AuthorAliasID"))
 comm.Parameters.Append comm.CreateParameter ("@varRelationship",200,1,8,varStatus)
 comm.Parameters.Append comm.CreateParameter ("@NumberOfEntries",3,4,3,Empty)
 comm.Parameters.Append comm.CreateParameter ("@NumberOfTables",3,4,3,Empty)
 comm.Parameters.Append comm.CreateParameter ("@NumberOfLeftovers",3,4,3,Empty)
 comm.Execute

 If (comm.Parameters("@NumberOfTables") > 0) Then
  Response.Write("<BR>")
  If (Request("Limit") <> "") Then
   Response.Write("<A HREF=" & """" & "toc.asp?AuthorAliasID=" & Request("AuthorAliasID") & """" & ">")
   Response.Write("Most Recent Entries")
   Response.Write("</A>")
  End If
 
  For intIndex = 1 to comm.Parameters("@NumberOfTables")-1
   Response.Write("<BR>")
   If (int(Request("Limit")) <> comm.Parameters("@NumberOfEntries") - (intIndex * 50)) Then
    Response.Write("<A HREF=" & """" & "toc.asp?AuthorAliasID=" & Request("AuthorAliasID"))
    Response.Write("&" & "Limit=" & (comm.Parameters("@NumberOfEntries") - (intIndex * 50)) & """")
    Response.Write(">Entries " & ((comm.Parameters("@NumberOfEntries") - ((intIndex + 1) * 50)) + 1) & " to ")
    Response.Write((comm.Parameters("@NumberOfEntries") - (intIndex * 50)))
    Response.Write("</A>")
   Else
    Response.Write("Entries " & ((comm.Parameters("@NumberOfEntries") - ((intIndex + 1) * 50)) + 1) & " to ")
    Response.Write((comm.Parameters("@NumberOfEntries") - (intIndex * 50)))  
   End If
  Next
 
  Response.Write("<BR>")
  Response.Write("<A HREF=" & """" & "toc.asp?AuthorAliasID=" & Request("AuthorAliasID"))
  Response.Write("&" & "Limit=" & comm.Parameters("@NumberOfLeftovers") & """")
  Response.Write(">Entries 1 to " & comm.Parameters("@NumberOfLeftovers"))
 End If
 Set rs = Nothing
 Set comm = Nothing
 
 Response.Write("</TD></TR>")

End If
%>
     </TABLE>
    </TD>
   </TR>

             </p>
               
            </p>  </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
 
  <tr>
    <td class="btfoot">
      <div align="center"><FONT face=Verdana>© 2002 Teen Writing Net. All rights reserved. Page design by </FONT>  
                   <!--#include file = "footer.xhtml"-->  <br>
                           
          <a href="http://www.teenwriting.net" target="_blank"><FONT
      face=Verdana>TEEN WRITING NET</FONT> </FONT></a><FONT
      face=Verdana>.</FONT></FONT></div></td></tr></table></FONT>
</body>
</html>


please help tell me what i'm doing wrong
mtrxpoetAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SpideyModConnect With a Mentor Commented:
PAQ'd and points refunded pre request at:
http://www.experts-exchange.com/Community_Support/Q_20540167.html

SpideyMod
Community Support Moderator @Experts Exchange
0
 
mtrxpoetAuthor Commented:
never mind i just posted the wrong ? again. damn me
0
 
mgfranzCommented:
Option Explicit has to be at the top of the page.
0
 
mtrxpoetAuthor Commented:
yeah i know. this was an old page i had not my new one. thanks thou
0
All Courses

From novice to tech pro — start learning today.