|
<%@ language="vbscript" %>
<html>
<head>
<title>查看讨论主题</title>
</head>
<body>
<! - -#include virtual="/adovbs.inc"- ->
<p><a href="newTheme.asp" title="发起新的讨论主题">发起新贴</a></p>
<hr color="red" size="1" noshade>
<div align="center">
<%
dim cnn,rst,sSQL,currentPage,rowCount,i
currentPage=Request.QueryString("currentPage")
if currentPage=" " then
currentPage-1
end if
set cnn=Server.CreateObject("ADODB.Connection")
set rst=Server.CreateObject("ADODB.Recordset")
cnn.ConnectionString= "driver={SQL Server};Server=ME;uid=sa;pwd=;database=test"
cnn.Open
set rst=cnn.Execute("articles", ,adCmdTable)
if rst.EOF then
Response.Write "<p><b>当前没有讨论主题目!</b></p>"
Response.End
end if
rst.Close
rst.CursorType=adOpenStatic
rst.PageSize = 5
sSQL="select * from articles order by issue_time desc"
rst.Open sSQL,cnn
rst.AbsolutePage=CInt(currentPage)
rowCount = 0
%>
<table border="0" cellpadding="2" cellspacing="2" width="100%">
<tr bgcolor="#0084CA">
<th>作者</th><th>IP地址</th><th>主题</th>
<th>发表时间</th><th>浏览次数</th><th>回复次数</th>
</tr>
<tr>
<% while not rst.EOF and rowCount < rst.PageSize %>
<tr bgcolor="#D9F2FF">
<td><% = rst("author") %><img src=<% = rst(pic_path) %>></td>
<td><% = rst("ip_addr") %></td>
<td><a href=' replyTheme.asp?id=<% = rst("art_id") %>'>
<% =rst("theme") %></a></td>
<td><% = rst("issue_time") %></td>
<td><% = rst("view_times") %></td>
<td><% = rst("reply_times") %></td>
</tr>
<%
rowCount=rowCount+1
rst.MoveNext
wend
%>
</table>
<p>当前主题数<% = rst.RecordCount %>
每页<% = rst.PageSize %>个主题
当前页次:<% = currentPage %>/<% = rst.PageCount %>页
<%
for i=1 to rst.PageCount
if i=CInt(currentPage) then
%>
[<font color="red"><% = i %></font>]
<%
else
%>
[<a href="forum.asp?currentPage=<% = i %>"><%= i %></a>]
<%
end if
next
%>
</p>
</div>
</body>
</html>
请问上面红色的那行代码为什么老是报这样错误:
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
在哪里错了? |
|