2013-01-21 41 views
0

我不知道如何解决以下错误:预计年底ASP错误

Microsoft VBScript compilation error '800a03f6' 

Expected 'End' 

/junk/test.asp, line 103 

else 
^ 

相关代码:

 <% 
    con.MoveNext() 
    Wend 
     %> 
    </table> 


    <% else %> 

    <p>No seminars available.</p> 

    <% 
    end if 
    con.close 
    %> 

整个代码:

<%@ LANGUAGE="VBSCRIPT" %> 

<% 
     Dim connectString, connect, conDB, con, src_st 
     connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" & Server.MapPath("data") 
     src_st = Request.QueryString("state") 
     set connect = Server.CreateObject("ADODB.connection") 
     connect.open connectString 
     if src_cat = "" then 
     conDB = "SELECT * FROM travel.csv" 
     else 
     conDB = "SELECT * FROM travel.csv where state = ' & src_st & '" 

     set con = connect.execute(conDB) 
%> 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
<head> 

<title>Seminars &amp; workshops - AvSafety Seminars</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<link rel="stylesheet" type="text/css" media="screen" href="/style/screen.css" /> 
<link rel="stylesheet" type="text/css" media="screen" href="/style/avsafety.css" /> 
<link rel="stylesheet" type="text/css" media="handheld" href="/style/handheld.css" /> 
<link rel="stylesheet" type="text/css" media="print" href="/style/print.css" /> 

<meta name="MSSmartTagsPreventParsing" content="true" /> 


<style type="text/css"> 
<!-- 
.style2 {color: #666666 } 
--> 
</style> 

<!-- 

--> 


</head> 
<body> 

<div id="printtitle">Civil Aviation Safety Authority</div> 
<div id="outer_wrapper"> 
<div id="wrapper"> 
<div id="container"> 
<div id="title"><h1>&nbsp;</h1></div> 



     <img src="images/windsock.jpg" alt="" width="166" height="500" align="right" /> 
<div id="content"> 

<!--Start of main content area--> 

<div id="right"> <img src="/wcmswr/_assets/main/seminars/images/AVSAFETY-LOGO.GIF" alt="AVSafety logo" border="0" width="250px" height="50px"> 


</div> 
     <h1>AvSafety Seminars</h1> 

<p>CASA is continuing with the Safety Seminar program, targeting pilots in regional Australia and run in partnership with the local aviation industry. </p> 
<p>We also hold seminars targeted at engineers.</p> 
<p><a href="/scripts/nc.dll?WCMS:STANDARD::pc=PC_100841">View further information on safety issues and topics</a>.</p> 

<h2>Request a seminar</h2> 
<p> If you would like to request an AvSafety seminar in your local town, use the <a href="/scripts/nc.dll?WCMS:STANDARD::pc=PC_100683">AvSafety request from</a>.</p> 

<h2>2013 Seminar schedule</h2> 

<p>In 2013 CASA ASAs will be focusing on visiting organisations to discuss the forthcoming aviation regulatory changes. They will be in all regions of Australia and individuals or organisations are welcome to contact their local region ASA to arrange an appointment time. The approximate travel schedule for each region is shown below. ASAs are available and active each month for visits within capital city environs (approximately within 2 hours driving of a capital city).</p> 
<p>Aero clubs and other aviation organisation are welcome to run Aviation Safety Seminars with ASAs presenting topics, however CASA will not be financially supporting the events. If you would like to run a seminar with ASA attendance, please use the <a href="/scripts/nc.dll?WCMS:STANDARD::pc=PC_100683">AvSafety request from</a> and complete the details of the request. Every effort will be made to provide support however it will be advantageous to consider timings when an ASA is visiting a local region. 
</p> 

<p><a href="avsafety?src_st=ACT">ACT</a> | <a href="avsafety?src_st=NSW">NSW</a> | <a href="avsafety?src_st=ACT">QLD</a> | <a href="avsafety?src_st=ACT">SA</a> | <a href="avsafety?src_st=ACT">TAS</a> | <a href ="avsafety?src_st=ACT">VIC</a> | <a href="#">WA</a></p> 

    <table> 
    <tr> 
     <th>Location</th> 
     <th>State</th> 
     <th>Date</th> 
    </tr> 

<% while (NOT con.EOF) %> 

    <tr> 
     <td><%=con("location")%></td> 
     <td><%=con("state")%></td> 
     <td><%=con("date")%></td> 
    </tr> 

     <% 
    con.MoveNext() 
    Wend 
     %> 
    </table> 


    <% else %> 

    <p>No seminars available.</p> 

    <% 
    end if 
    con.close 
    %> 

<!--End of main content area--> 
</div> <!-- content --> 
</div> <!-- container --> 

<div id="sidebar"> 
<h2 id = "sidebarhome"><a href="/index.htm">CASA home</a></h2> 
<h2><a href="/seminars/index.htm">Seminars &amp; workshops</a></h2> 
<ul> 

<li><a href="/seminars/avsafety.asp">AvSafety Seminars</a> </li> 
    <li> <a href="/seminars/eng.htm">Maintenance seminars</a></li> 
    <li><a href="/seminars/archerfield.htm">Archerfield chief pilots</a></li> 
<li><a href="/seminars/cbt/index.htm">Competency Based Training Education</a></li> 
<li><a href="/seminars/manufacturing.htm">Manufacturing & certification workshop</a></li> 
</ul> 

<form action="http://agencysearch.australia.gov.au/search/search.cgi" name="agencysearch"> 
<input type="text" name="query" size="13" maxlength="50" value="" alt="Search field" /> 
<input type="hidden" name="collection" value="agencies" /> 
<input type="hidden" name="form" value="simple" /> 
<input type="hidden" name="profile" value="casa" /> 
<input type="submit" value="Search" name="Search" alt="Search button" /> 
</form> 

</div> 

<div class="clearing">&nbsp;</div> 
</div><!-- wrapper --> 
</div> <!-- outer_wrapper --> 

<div class="extras"> 
<a href="/tools/contacts.asp">Contact CASA</a> 
</div> 

<div class="footer"> 
<a href="/tools/siteinfo.htm">Site&nbsp;help</a>&nbsp; |&nbsp; 
<a href="/tools/cpyright.htm">Copyright </a>&nbsp; |&nbsp; <a href="/tools/privacy/index.htm">Privacy</a> 
</div> 

</body> 
</html> 
+0

在我还没有看到之前,没有“if”。 –

+0

如果我删除别的我得到 “Microsoft VBScript运行时错误 '800a01a8' 所需的 对象: '' /junk/test.asp,行109” – sephiith

+0

的结构是'if..else..endif'。所以要么全部保留3,要么删除'else'和'endif'。 –

回答

1

如果你改变你的代码到这?

<% 
     Dim connectString, connect, conDB, con, src_st 
     connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" & Server.MapPath("data") 
     src_st = Request.QueryString("state") 
     set connect = Server.CreateObject("ADODB.connection") 
     connect.open connectString 
     if src_cat = "" then 
     conDB = "SELECT * FROM travel.csv" 
     else 
     conDB = "SELECT * FROM travel.csv where state = '" & src_st & "'" 
     end if 

     set con = connect.execute(conDB) 
%> 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
<head> 

<title>Seminars &amp; workshops - AvSafety Seminars</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<link rel="stylesheet" type="text/css" media="screen" href="/style/screen.css" /> 
<link rel="stylesheet" type="text/css" media="screen" href="/style/avsafety.css" /> 
<link rel="stylesheet" type="text/css" media="handheld" href="/style/handheld.css" /> 
<link rel="stylesheet" type="text/css" media="print" href="/style/print.css" /> 

<meta name="MSSmartTagsPreventParsing" content="true" /> 


<style type="text/css"> 
<!-- 
.style2 {color: #666666 } 
--> 
</style> 

<!-- 

--> 


</head> 
<body> 

<div id="printtitle">Civil Aviation Safety Authority</div> 
<div id="outer_wrapper"> 
<div id="wrapper"> 
<div id="container"> 
<div id="title"><h1>&nbsp;</h1></div> 



     <img src="images/windsock.jpg" alt="" width="166" height="500" align="right" /> 
<div id="content"> 

<!--Start of main content area--> 

<div id="right"> <img src="/wcmswr/_assets/main/seminars/images/AVSAFETY-LOGO.GIF" alt="AVSafety logo" border="0" width="250px" height="50px"> 


</div> 
     <h1>AvSafety Seminars</h1> 

<p>CASA is continuing with the Safety Seminar program, targeting pilots in regional Australia and run in partnership with the local aviation industry. </p> 
<p>We also hold seminars targeted at engineers.</p> 
<p><a href="/scripts/nc.dll?WCMS:STANDARD::pc=PC_100841">View further information on safety issues and topics</a>.</p> 

<h2>Request a seminar</h2> 
<p> If you would like to request an AvSafety seminar in your local town, use the <a href="/scripts/nc.dll?WCMS:STANDARD::pc=PC_100683">AvSafety request from</a>.</p> 

<h2>2013 Seminar schedule</h2> 

<p>In 2013 CASA ASAs will be focusing on visiting organisations to discuss the forthcoming aviation regulatory changes. They will be in all regions of Australia and individuals or organisations are welcome to contact their local region ASA to arrange an appointment time. The approximate travel schedule for each region is shown below. ASAs are available and active each month for visits within capital city environs (approximately within 2 hours driving of a capital city).</p> 
<p>Aero clubs and other aviation organisation are welcome to run Aviation Safety Seminars with ASAs presenting topics, however CASA will not be financially supporting the events. If you would like to run a seminar with ASA attendance, please use the <a href="/scripts/nc.dll?WCMS:STANDARD::pc=PC_100683">AvSafety request from</a> and complete the details of the request. Every effort will be made to provide support however it will be advantageous to consider timings when an ASA is visiting a local region. 
</p> 

<p><a href="avsafety?src_st=ACT">ACT</a> | <a href="avsafety?src_st=NSW">NSW</a> | <a href="avsafety?src_st=ACT">QLD</a> | <a href="avsafety?src_st=ACT">SA</a> | <a href="avsafety?src_st=ACT">TAS</a> | <a href ="avsafety?src_st=ACT">VIC</a> | <a href="#">WA</a></p> 

    <table> 
    <tr> 
     <th>Location</th> 
     <th>State</th> 
     <th>Date</th> 
    </tr> 

<% 
if NOT con.eof then 
while (NOT con.EOF) %> 

    <tr> 
     <td><%=con("location")%></td> 
     <td><%=con("state")%></td> 
     <td><%=con("date")%></td> 
    </tr> 

     <% 
    con.MoveNext() 
    Wend 
     %> 
    </table> 


    <% else %> 

    <p>No seminars available.</p> 

    <% 
    end if 
    con.close 
    %> 

<!--End of main content area--> 
</div> <!-- content --> 
</div> <!-- container --> 

<div id="sidebar"> 
<h2 id = "sidebarhome"><a href="/index.htm">CASA home</a></h2> 
<h2><a href="/seminars/index.htm">Seminars &amp; workshops</a></h2> 
<ul> 

<li><a href="/seminars/avsafety.asp">AvSafety Seminars</a> </li> 
    <li> <a href="/seminars/eng.htm">Maintenance seminars</a></li> 
    <li><a href="/seminars/archerfield.htm">Archerfield chief pilots</a></li> 
<li><a href="/seminars/cbt/index.htm">Competency Based Training Education</a></li> 
<li><a href="/seminars/manufacturing.htm">Manufacturing & certification workshop</a></li> 
</ul> 

<form action="http://agencysearch.australia.gov.au/search/search.cgi" name="agencysearch"> 
<input type="text" name="query" size="13" maxlength="50" value="" alt="Search field" /> 
<input type="hidden" name="collection" value="agencies" /> 
<input type="hidden" name="form" value="simple" /> 
<input type="hidden" name="profile" value="casa" /> 
<input type="submit" value="Search" name="Search" alt="Search button" /> 
</form> 

</div> 

<div class="clearing">&nbsp;</div> 
</div><!-- wrapper --> 
</div> <!-- outer_wrapper --> 

<div class="extras"> 
<a href="/tools/contacts.asp">Contact CASA</a> 
</div> 

<div class="footer"> 
<a href="/tools/siteinfo.htm">Site&nbsp;help</a>&nbsp; |&nbsp; 
<a href="/tools/cpyright.htm">Copyright </a>&nbsp; |&nbsp; <a href="/tools/privacy/index.htm">Privacy</a> 
</div> 

</body> 
</html> 
+0

该工程。我仍然不明白为什么它不工作。 – sephiith

+0

@sephiith你错过了一个结束,如果我刚刚添加了一个空记录集检查 – SearchAndResQ