ASP调试错误,哪个问题?

斑马智库 2009-08-04 02:02:34
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
/jidahousecom/房123/cn/111.asp, 第 44 行

代码如下:
<%
mymenu="show"
myurl="show.asp"
myname="新房展示"
classcode=61

keyno=Request.QueryString("keyno")
if keyno="" or not isnumeric(keyno) then keyno=0 end if
tem=Request.QueryString("tem")
if tem="" then tem=1 end if
select case tem
case 1 : keyname="基本信息"
case 2 : keyname="楼盘介绍"
case 3 : keyname="开发商简介"
case 4 : keyname="外景效果图"
case 5 : keyname="户型展示"
case 6 : keyname="物业管理"
end select

myurl2="show_info.asp?keyno="&keyno

sql="select * from subs where id="&keyno&" and pid=11 and usefulness=1"
rs.open sql,cn,1,1
if not rs.eof then
rstitle=rs("title")
rscontent=rs("content")
rscontent3=rs("content3")
rscontent4=rs("content4")
rscity=rs("city")
rswtype=rs("wtype")
rslocal=rs("local")
rscertcode=rs("certcode")
rswdate=rs("wdate")
rswprice=rs("wprice")
rstel=rs("tel")
rsaddress=rs("address")
rspid2=rs("pid2")
rspicflag=rs("picflag")
rspicflag2=rs("picflag2")
end if
rs.close
sql="select id,title,content from subs2 where id="&rspid2
rs.open sql,cn,1,1第44行
if not rs.eof then
rstitle2=rs("title")
rscontent2=rs("content")
end if
rs.close
%>



<td width="101"><table width="98" border="0" cellspacing="0" cellpadding="0">
<tr> <%
rstitle=">> 基本信息"
gif="2"
link="link5"
if tem=1 then
rstitle="<font color=ffffff>"&rstitle&"</font>"
gif="1"
link="link1"
end if%>
<td height="19" align="center" background="images/show/bg_title_<%=gif%>.gif"><a href="<%=myurl2%>&tem=1" class="<%=link%>"><%=rstitle%></a>
</td>
</tr>
</table></td>
<td width="101"><table width="98" border="0" cellspacing="0" cellpadding="0">
<tr> <%
rstitle=">> 楼盘介绍"
gif="2"
link="link5"
if tem=2 then
rstitle="<font color=ffffff>"&rstitle&"</font>"
gif="1"
link="link1"
end if%>
<td height="19" align="center" background="images/show/bg_title_<%=gif%>.gif"><a href="<%=myurl2%>&tem=2" class="<%=link%>"><%=rstitle%></a>
</td>
</tr>
</table></td>
<td width="101"><table width="98" border="0" cellspacing="0" cellpadding="0">
<tr> <%
rstitle=">> 开发商简介"
gif="2"
link="link5"
if tem=3 then
rstitle="<font color=ffffff>"&rstitle&"</font>"
gif="1"
link="link1"
end if%>
<td height="19" align="center" background="images/show/bg_title_<%=gif%>.gif"><a href="<%=myurl2%>&tem=3" class="<%=link%>"><%=rstitle%></a>
</td>
</tr>
</table></td>
<%if rspicflag2=1 then%>
<td width="101"><table width="98" border="0" cellspacing="0" cellpadding="0">
<tr> <%
rstitle=">> 外景效果图"
gif="2"
link="link5"
if tem=4 then
rstitle="<font color=ffffff>"&rstitle&"</font>"
gif="1"
link="link1"
end if%>
<td height="19" align="center" background="images/show/bg_title_<%=gif%>.gif"><a href="myasp_bigpic_display.asp?keyno=<%=keyno%>&code=2&tablename=subs" target=_blank class="<%=link%>"><%=rstitle%></a>
</td>
</tr>
</table></td>
<%end if%>
<td width="101"><table width="98" border="0" cellspacing="0" cellpadding="0">
<tr> <%
rstitle=">> 户型展示"
gif="2"
link="link5"
if tem=5 then
rstitle="<font color=ffffff>"&rstitle&"</font>"
gif="1"
link="link1"
end if%>
<td height="19" align="center" background="images/show/bg_title_<%=gif%>.gif"><a href="<%=myurl2%>&tem=5" class="<%=link%>"><%=rstitle%></a>
</td>
</tr>
</table></td>
<td width="101"><table width="98" border="0" cellspacing="0" cellpadding="0">
<tr> <%
rstitle=">> 物业管理"
gif="2"
link="link5"
if tem=6 then
rstitle="<font color=ffffff>"&rstitle&"</font>"
gif="1"
link="link1"
end if%>
<td height="19" align="center" background="images/show/bg_title_<%=gif%>.gif"><a href="<%=myurl2%>&tem=6" class="<%=link%>"><%=rstitle%></a>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
...全文
101 16 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
ilxl520 2009-08-05
  • 打赏
  • 举报
回复
这个错误信息比较复杂,不过一般都是数据库方面的问题
fumingk 2009-08-04
  • 打赏
  • 举报
回复
您没有创建结果集

如果创建了不好使的话 建议试试这个
set rs=conn.execute(sql语句)
sinbasara 2009-08-04
  • 打赏
  • 举报
回复
我也遇到过,当时是SQL语法问题,郁闷...................
lingfeng179 2009-08-04
  • 打赏
  • 举报
回复
数据库连接的时候出现问题了 你看一下你的conn
文件 应该是权限问题我也遇到过
qwegis 2009-08-04
  • 打赏
  • 举报
回复
对 没有创建RS
sumjor 2009-08-04
  • 打赏
  • 举报
回复
没有rs
set rs = Server.CreateObject("ADODB.RecordSet")
来还债 2009-08-04
  • 打赏
  • 举报
回复
数据库的权限是只读的。应该给个everyone 。试试
fwq21 2009-08-04
  • 打赏
  • 举报
回复
改为:rs.open sql,cn,1,3
number123456 2009-08-04
  • 打赏
  • 举报
回复
set rs = Server.CreateObject("ADODB.RecordSet")
Set cn = Server.CreateObject("ADODB.Connection")
凡夫与俗子 2009-08-04
  • 打赏
  • 举报
回复
rs没创建呢。在第一次需要rs时就创建,然后共用!
myurl2="show_info.asp?keyno="&keyno

set rs=server.createobject("adodb.recordset") '加上这句
sql="select * from subs where id="&keyno&" and pid=11 and usefulness=1"
rs.open sql,cn,1,1
...
rs.close

.....
rs.open ....
....'继续操作
王者coco 2009-08-04
  • 打赏
  • 举报
回复
没有创建rs吧?
hookee 2009-08-04
  • 打赏
  • 举报
回复
rs创建了吗?
set rs = CreateObject("ADODB.RecordSet")
rs.CursorLocation = 3
rs.open sql,cn,1,1
.....
shaomingmark 2009-08-04
  • 打赏
  • 举报
回复
rspid2=rs("pid2") //这个位置就是你下面sQL中传入的参数

rs.close //但是你在这个位置将记录集rs关闭了

sql="select id,title,content from subs2 where id="&rspid2 //在这里引用rspid2时不存在的。主要原因是你在引用的时候已经将rs关闭了。

所以你在执行这句的时候出错 rs.open sql,cn,1,1
hookee 2009-08-04
  • 打赏
  • 举报
回复
查一下rspid2 的值取到了?
斑马智库 2009-08-04
  • 打赏
  • 举报
回复
init.asp是共用文件,其他页面都好用,就是这个页面打不开??????????
斑马智库 2009-08-04
  • 打赏
  • 举报
回复
set rs = Server.CreateObject("ADODB.RecordSet")
Set cn = Server.CreateObject("ADODB.Connection")

在<!--#include file=init.asp-->中已经创建,不是这个问题

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧