| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 331 人关注过本帖
标题:大虾看一下这段代码为什么会出现这样的错误
只看楼主 加入收藏
kombel
Rank: 2
等 级:论坛游民
帖 子:69
专家分:48
注 册:2011-6-15
结帖率:92.31%
收藏
已结贴  问题点数:20 回复次数:3 
大虾看一下这段代码为什么会出现这样的错误
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/1/untitled1.asp, 第 14 行
程序代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <%dim rs
set rs=server.createobject("adodb.recordset")
sql="select * from cominfo order by comid desc"
rs.open sql,conn,1,3
IF not rs.eof Then
proCount=rs.recordcount
rs.PageSize=25       '定义显示数目
   if not IsEmpty(Request("ToPage")) then
        ToPage=CInt(Request("ToPage"))
     if ToPage>rs.PageCount then
      rs.AbsolutePage=rs.PageCount
      intCurPage=rs.PageCount
     elseif ToPage<=0 then
      rs.AbsolutePage=1
      intCurPage=1
     else
      rs.AbsolutePage=ToPage
      intCurPage=ToPage
     end if
    else
           rs.AbsolutePage=1
      intCurPage=1
    end if
intCurPage=CInt(intCurPage)
k=1
do while Not rs.eof and k<5 '控制显示行数
%>
              <tr>
                <%
for n=1 to 5
%>
            <td align="center"><table width="19%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td align="center">
                        <table border="0" cellpadding="0" cellspacing="3" align="center">
                          <tr>
                            <td><table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td><table width="120" height="100" border="0" cellpadding="1" cellspacing="1" bgcolor="#666600">
                                      <tr>
                                        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>

 <td width="120" height="100"  align="center"><span href="showproduct.asp?id=<%=rs("comid")%>" target=_blank><img src="<%=rs("comurl")%>" width="120" height="120" border="0" /></a></span></td>
                                            </tr>
                                        </table></td>
                                      </tr>
                                  </table></td>
                              </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td>
                              <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td><div align="center"><font color="#E23C08">
                                  <% if len(rs("commodel"))<=8 then
                                     Response.write rs("commodel")
                                     else
                                     response.write left(rs("commodel"),8)&"..."
                                     end if
                                     %>
                                     </font></div></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table>
       </td>
                    </tr>
                </table>
              </td>
                <%
rs.movenext
if rs.eof then exit for
if rs.eof then exit do
Next
%>
              </tr>
              <%
k=k+1
Loop
%>
</table></td>
        </tr>
                  </table>
                    <table width="100%" height="57" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="56">
                            <div align="right"><span style="font-size: 9pt;"> 总共:<font color="#ff0000"><%=rs.PageCount%></font>页, <font color="#ff0000"><%=proCount%></font>个产品, 当前页:<font color="#ff0000"> <%=intCurPage%> </font>
                                  <% if intCurPage<>1 then
    %>
                                  <a href="?ToPage=1">首页</a>|<a href="?ToPage=<%=intCurPage-1%>">上一页</a>|
                                  <% end if
if intCurPage<>rs.PageCount then %>
                                  <a href="?ToPage=<%=intCurPage+1%>">下一页</a>|<a href="?ToPage=<%=rs.PageCount%>"> 最后一页</a>
                                  <% end if%>
                            </span></div>
                          </form>
                            <div align="right">
                              <%end if%>
                          </div></td>
                      </tr>
                  </table></td>
              </tr>
            </table>

</body>
</html>

2011-06-15 15:30
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:20 
你的数据库连接代码在哪里?

----我怎能在别人的苦难面前转过脸去----
2011-06-15 15:40
kombel
Rank: 2
等 级:论坛游民
帖 子:69
专家分:48
注 册:2011-6-15
收藏
得分:0 
回复 2楼 dzt0001
嗯 就是没有数据库链接
问题解决 了  谢谢  提醒
2011-06-16 08:51
kombel
Rank: 2
等 级:论坛游民
帖 子:69
专家分:48
注 册:2011-6-15
收藏
得分:0 
  学习了
2011-06-24 10:45
快速回复:大虾看一下这段代码为什么会出现这样的错误
数据加载中...
 
   



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

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