asp和vbs的高手们请进
<%setconn=server.createobject("adodb.connection")conn.open"driver={microsoftaccessdri...
<%set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("test.mdb")
%>
<%
exec="select * from test "
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
rs.PageSize=8
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then
page=1
end if
rs.AbsolutePage=page
%>
<a href="search.html" target="_self">搜索</a><br>
<a href="add.html" target="_self">留言</a><br>
<table width="748" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>del</td>
<td>name</td>
<td>message</td>
</tr>
<%for i=1 to rs.PageSize%>
<%if rs.EOF then
exit for
end if%>
<tr>
<td><a href="del.asp?id=<%=rs("id")%>">del</a></td>
<td><a href="search.asp?id=<%=rs("id")%>" target="_self"><%=rs("name")%></a></td>
<td><%=rs("message")%></td>
</tr>
<%rs.movenext
next
%><tr>
<td colspan=3 align=right>
<%if page=1 and not page=pagecount then%>
<div align="right">第<%=page%>页 <%for i=1 to pagecount%>
<a href="book.asp?page=<%=i%>"><%=i%></a> <%next%><a href="book.asp?page=<%=page+1%>">下一页</a> </div>
<%elseif page=pagecount and not page=1 then%>
<div align="right">第<%=page%>页 <%for i=1 to pagecount%>
<a href="book.asp?page=<%=i%>"><%=i%></a> <%next%><a href="book.asp?page=<%=page-1%>">上一页</a> </div>
<%elseif page<1 then%><div class="font" align="right"><font color=red>没有任何记录!</font></div>
<%elseif page>pagecount then%><div class="font" align="right"><font color=red>没有任何记录!</font></div>
<%elseif page=1 and page=pagecount then%>
<%else%>
<div align="right">第<%=page%>页 <%for i=1 to pagecount%>
<a href="book.asp?page=<%=i%>"><%=i%></a> <%next%><a href="book.asp?page=<%=page-1%>">上一页</a>
<a href="book.asp?page=<%=page+1%>">下一页</a> </div>
<%end if%>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
---------------------------------
这个列表主要是用asp写的,现在换成主要用vbs写,麻烦各位大大们帮忙改下!先谢了 展开
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("test.mdb")
%>
<%
exec="select * from test "
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
rs.PageSize=8
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then
page=1
end if
rs.AbsolutePage=page
%>
<a href="search.html" target="_self">搜索</a><br>
<a href="add.html" target="_self">留言</a><br>
<table width="748" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>del</td>
<td>name</td>
<td>message</td>
</tr>
<%for i=1 to rs.PageSize%>
<%if rs.EOF then
exit for
end if%>
<tr>
<td><a href="del.asp?id=<%=rs("id")%>">del</a></td>
<td><a href="search.asp?id=<%=rs("id")%>" target="_self"><%=rs("name")%></a></td>
<td><%=rs("message")%></td>
</tr>
<%rs.movenext
next
%><tr>
<td colspan=3 align=right>
<%if page=1 and not page=pagecount then%>
<div align="right">第<%=page%>页 <%for i=1 to pagecount%>
<a href="book.asp?page=<%=i%>"><%=i%></a> <%next%><a href="book.asp?page=<%=page+1%>">下一页</a> </div>
<%elseif page=pagecount and not page=1 then%>
<div align="right">第<%=page%>页 <%for i=1 to pagecount%>
<a href="book.asp?page=<%=i%>"><%=i%></a> <%next%><a href="book.asp?page=<%=page-1%>">上一页</a> </div>
<%elseif page<1 then%><div class="font" align="right"><font color=red>没有任何记录!</font></div>
<%elseif page>pagecount then%><div class="font" align="right"><font color=red>没有任何记录!</font></div>
<%elseif page=1 and page=pagecount then%>
<%else%>
<div align="right">第<%=page%>页 <%for i=1 to pagecount%>
<a href="book.asp?page=<%=i%>"><%=i%></a> <%next%><a href="book.asp?page=<%=page-1%>">上一页</a>
<a href="book.asp?page=<%=page+1%>">下一页</a> </div>
<%end if%>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
---------------------------------
这个列表主要是用asp写的,现在换成主要用vbs写,麻烦各位大大们帮忙改下!先谢了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询