| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 518 人关注过本帖
标题:参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突?
只看楼主 加入收藏
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
 问题点数:0 回复次数:7 
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突?
<%@ 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 %>&nbsp;
每页<% = rst.PageSize %>个主题&nbsp;
当前页次:<% = currentPage %>/<% = rst.PageCount %>页&nbsp;
<%
for i=1 to rst.PageCount
if i=CInt(currentPage) then
%>
[<font color="red"><% = i %></font>]&nbsp;&nbsp;
<%
else
%>
[<a href="forum.asp?currentPage=<% = i %>"><%= i %></a>]&nbsp;&nbsp;
<%
end if
next
%>
</p>
</div>
</body>
</html>
请问上面红色的那行代码为什么老是报这样错误:
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
在哪里错了?
搜索更多相关主题的帖子: 参数 类型 范围 
2006-03-30 15:39
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
currentPage不是数字就会这样
2006-03-30 15:48
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
得分:0 
那要怎么改呢?
2006-03-30 16:00
google
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:3419
专家分:23
注 册:2005-11-1
收藏
得分:0 
改成数字的

祝天下所有母亲幸福安康!~
2006-03-30 16:01
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
得分:0 

呵呵,我也知道要改成数字,只是我不知怎么改?还请你们多指点指点.
if currentPage=" " then
currentPage-1
这行代码错了,是这样的:
if currentPage=" " then
currentPage=1

2006-03-30 16:06
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
得分:0 
请指点一下
2006-03-30 16:30
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
得分:0 

请高手进来指导我一下呀,帮帮忙

2006-03-30 20:24
rainic
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2367
专家分:0
注 册:2005-8-9
收藏
得分:0 
'''''''''变成整形数字
function makeNum(num)
dim n
n=1
if num<>"" then
if isNumeric(num) then
n=Cint(num)
end if
end if
makeNum=n
end function

2006-03-30 21:16
快速回复:参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016497 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved