主题:请高手帮忙看下我这个ASP代码哪里有问题,怎么运行老是报错
<div align="center">
<h2>数据库查询</h2>
<table border="1" cellpadding="3" cellspacing="0" bordercolor="#FFDFBF" width="50%" id="AutoNumber1">
<form method="post" name="myform" action="mpsbclsjcx.asp">
<tr>
<td width="19%" align="center"> 查询条件: </td>
<td width="30%" align="left">
<select size="1" name="action">
<option value="qyname" selected="selected">公司名称</option>
<option value="cpname">产品名称</option>
</select>  </td>
<td width="14%" height="29"> 关键字:</td>
<td width="37%" align="left"><input type="text" name="Keyword" size="16" class="input" value="" align="middle">    <input type="submit" value="搜 索"></td>
</tr>
</form>
</td>
</tr>
</table>
<%
if keyword="" then
%>
<%
response.Write("说明:")
response.Write("如果您想查询某种产品的数据库信息,</br> 请添入查询关键字内容进行查询,您将获得更准确的查询结果;")%>
<%
set conn=server.CreateObject("adodb.connection")
dbpath = server.MapPath("database/#####.asp")
conn.open "driver={microsoft access driver (*.mdb)};dbq=" & dbpath
%>
<%set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from "& db_mpsbcl_Table
rs.open rs.Source,conn,1,3
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from "& db_mpsbcl_Table
rs.Open rs.Source,conn,3,1
If Not rs.eof then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
end if
%>
<table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFDFBF" width="50%" id="AutoNumber1">
<tr align="center" class="TDtop1">
<td width="7%" height="27">ID号</td>
<td width="34%">公司名称</td>
<td width="16%">产品名称</td>
<td width="15%">评选时间</td>
<td width="10%">有效时间</td>
</tr>
<%do while not rs.eof and (i <= MyPageSize)%>
<tr bgcolor=ffffff height="20">
<td width=7% align="center" ><%=rs("mpID")%></td>
<td width=39% align="center"><%=rs("qyname")%></td>
<td width=16% align="center" ><%=rs("cpname")%> </td>
<td width=10% align="center" ><%=rs("pxtime")%></td>
<td width=10% align="center"><%=rs("yxtime")%></td>
</tr>
<%rs.MoveNext
i = i + 1
loop%>
<tr>
</table></br>
共 <%=total%> 条,当前第 <%=Mypage%>/<%=Maxpages%> 页,每页 <%=MyPageSize%> 条
<%
url="chaxuntest1.asp?"
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/rs.PageSize)+1
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a href='" & Url & "page=" & PagePrev & "' title='上" & PageShowSize & "页'>上一翻页</a> "
Response.write "<a href='" & Url & "page=1' title='第1页'>页首</a> "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a href='" & Url & "page=" & Prev_Page & "' title='第" & Prev_Page & "页'>上一页</a> "
end if
if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "<a href='" & Url & "page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write "<B>["& PageLink &"]</B> "
end if
If PageLink = MaxPages Then Exit for
Next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a href='" & Url & "page=" & Next_Page & "' title='第" & Next_Page & "页'>下一页</A>"
end if
if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write " <A href='" & Url & "page=" & Pagetpage & "' title='第"& Pagetpage &"页'>页尾</A>"
Response.write " <a href='" & Url & "page=" & PageNext & "' title='下" & PageShowSize & "页'>下一翻页</a>"
End if
%>
<%
rs.close
set rs=nothing%>
</br>
</div>
</div>
<div class=clear_float></div><!--清除浮动属性-->
<!--中间内容部分结束-->
<!--#include file="bottom.asp"-->
<h2>数据库查询</h2>
<table border="1" cellpadding="3" cellspacing="0" bordercolor="#FFDFBF" width="50%" id="AutoNumber1">
<form method="post" name="myform" action="mpsbclsjcx.asp">
<tr>
<td width="19%" align="center"> 查询条件: </td>
<td width="30%" align="left">
<select size="1" name="action">
<option value="qyname" selected="selected">公司名称</option>
<option value="cpname">产品名称</option>
</select>  </td>
<td width="14%" height="29"> 关键字:</td>
<td width="37%" align="left"><input type="text" name="Keyword" size="16" class="input" value="" align="middle">    <input type="submit" value="搜 索"></td>
</tr>
</form>
</td>
</tr>
</table>
<%
if keyword="" then
%>
<%
response.Write("说明:")
response.Write("如果您想查询某种产品的数据库信息,</br> 请添入查询关键字内容进行查询,您将获得更准确的查询结果;")%>
<%
set conn=server.CreateObject("adodb.connection")
dbpath = server.MapPath("database/#####.asp")
conn.open "driver={microsoft access driver (*.mdb)};dbq=" & dbpath
%>
<%set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from "& db_mpsbcl_Table
rs.open rs.Source,conn,1,3
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from "& db_mpsbcl_Table
rs.Open rs.Source,conn,3,1
If Not rs.eof then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
end if
%>
<table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFDFBF" width="50%" id="AutoNumber1">
<tr align="center" class="TDtop1">
<td width="7%" height="27">ID号</td>
<td width="34%">公司名称</td>
<td width="16%">产品名称</td>
<td width="15%">评选时间</td>
<td width="10%">有效时间</td>
</tr>
<%do while not rs.eof and (i <= MyPageSize)%>
<tr bgcolor=ffffff height="20">
<td width=7% align="center" ><%=rs("mpID")%></td>
<td width=39% align="center"><%=rs("qyname")%></td>
<td width=16% align="center" ><%=rs("cpname")%> </td>
<td width=10% align="center" ><%=rs("pxtime")%></td>
<td width=10% align="center"><%=rs("yxtime")%></td>
</tr>
<%rs.MoveNext
i = i + 1
loop%>
<tr>
</table></br>
共 <%=total%> 条,当前第 <%=Mypage%>/<%=Maxpages%> 页,每页 <%=MyPageSize%> 条
<%
url="chaxuntest1.asp?"
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/rs.PageSize)+1
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a href='" & Url & "page=" & PagePrev & "' title='上" & PageShowSize & "页'>上一翻页</a> "
Response.write "<a href='" & Url & "page=1' title='第1页'>页首</a> "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a href='" & Url & "page=" & Prev_Page & "' title='第" & Prev_Page & "页'>上一页</a> "
end if
if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "<a href='" & Url & "page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write "<B>["& PageLink &"]</B> "
end if
If PageLink = MaxPages Then Exit for
Next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a href='" & Url & "page=" & Next_Page & "' title='第" & Next_Page & "页'>下一页</A>"
end if
if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write " <A href='" & Url & "page=" & Pagetpage & "' title='第"& Pagetpage &"页'>页尾</A>"
Response.write " <a href='" & Url & "page=" & PageNext & "' title='下" & PageShowSize & "页'>下一翻页</a>"
End if
%>
<%
rs.close
set rs=nothing%>
</br>
</div>
</div>
<div class=clear_float></div><!--清除浮动属性-->
<!--中间内容部分结束-->
<!--#include file="bottom.asp"-->