日期:2014-05-18  浏览次数:20449 次

[新手救助]为什么代码提示出错
<%
cc=request.form( "kok ")
if   cc= "ok "   then  
set   conn=server.createobject( "adodb.connection ")
conn.open   "driver={Microsoft   Access   driver   (*.mdb)};dbq= "&server.mappath( "kk.mdb ")
exec= "select   *   from   beok "
set   rs=server.createobject( "adodb.recordset ")
rs.open   exec,conn,1,3  
page=2
rs.pagesize=8
counts=5
allpages=rs.pagecount
rs.absolutepage=page
do   while   (not   rs.eof)   and   counts> 0   %>
<table   width= "536 "   height= "235 "   border= "1 "   cellpadding= "1 "   cellspacing= "0 "   bordercolor= "#CCCCCC "   bgcolor= "#FFFFFF ">
    <tr   bgcolor= "#FFFFFF ">
        <td> &ETH;&Otilde;&Atilde;&ucirc; </td>
        <td> ±&cedil;×&cent; </td>
        <td> &nbsp; </td>
    </tr>
    <tr   bgcolor= "#FFFFFF ">
        <td> <%=rs( "min ")%> </td>
        <td> <%=rs( "xin ")%> </td>
        <td> &nbsp; </td>
    </tr>
    <tr   bgcolor= "#FFFFFF ">
        <td> </td>
        <td> &nbsp; </td>
        <td> &nbsp; </td>
    </tr>
</table>
<%
counts=counts-1
rs.movenext
if   rs.eof   then   exit   do
loop
end   if
end   if
if   page=2   then  
response.write   "前页   后页 "
else  
response.write   " <a   href=pageview.asp?page=1> 首页 </a> "
                                " <a   href=pageview.asp?page= "&page-1& "> 前页 </a> "
end   if
if   page=allpages   then
response.write   "下页   末页 "
else
response.write   " <a   href=pageview.asp?page= "&page+1& "> 下页 </a>
                                <a   href=pageview.asp?page= "&allpages& "> 末页 </a> "

%>
提示出错内容:
end   if
if   page=2   then  
response.write   "??   ?? "
else  
response.write   "?? "[0]Script   error   detected   at   line   40,col[0].
Source   line:   end   if
Description:   缺少语句

怎么会呢?请高手指导

------解决方案--------------------
两个错误点,
第一个
if rs.eof then exit do
loop
end if
end if
多了一个end if
第二个地方
最后
if page=allpages then
response.write "下页 末页 "
else
response.write " <a href=pageview.asp?page= "&page+1& "&