sql语句的结果集的再用

lxw81p 2005-03-30 07:44:52
<%set rs=conn.execute("select * from pic where id="&id&"")%>

<%
set ty=rs("type")
sql3="select * from pic where type='ty' "
set rs3=conn.execute(sql3)
%>

表里有相应的值.下面的语句错在哪里?

应该怎样改?
...全文
147 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
winstarr 2005-03-31
  • 打赏
  • 举报
回复
<%
set rs=conn.execute("select * from pic where id="&id&"")
ty=rs("type")
sql3="select * from pic where type='"&ty&"'"
set rs3=conn.execute(sql3)
%>
fogheart 2005-03-31
  • 打赏
  • 举报
回复
<%
set rs=conn.execute("select * from pic where id="&id&"")
if not rs.eof then
ty=rs("type")
else
ty = ""
end if
sql3="select * from pic where type='"&ty&"'"
set rs3=conn.execute(sql3)
%>
lxw81p 2005-03-31
  • 打赏
  • 举报
回复
请问楼上,这个[]在这里有什么意思?谢谢
poron9 2005-03-31
  • 打赏
  • 举报
回复
<%
set rs=conn.execute("select * from pic where id="&id&"")
set ty=rs("type")
sql3="select * from pic where [type]='"&ty&"'"
set rs3=conn.execute(sql3)
%>
jzywh 2005-03-31
  • 打赏
  • 举报
回复
response.write sql3
jzywh 2005-03-31
  • 打赏
  • 举报
回复
respinse.write sql3
lxw81p 2005-03-30
  • 打赏
  • 举报
回复
<%
rs.close
set rs=nothing
%>
<%
rs3.close
set rs3=nothing
%>

我是放在最尾部
lxw81p 2005-03-30
  • 打赏
  • 举报
回复
还是没有成功
lxw81p 2005-03-30
  • 打赏
  • 举报
回复
错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录

--仍然是一个空的结果集,可是数据库里有这个值
zhutimy 2005-03-30
  • 打赏
  • 举报
回复
sql3="select * from pic where type='"&ty&"'"
mjpclab 2005-03-30
  • 打赏
  • 举报
回复
<%set rs=conn.execute("select * from pic where id="&id)%>

<%
ty=rs("type") '不要set
sql3="select * from pic where type='" & type & "'"
set rs3=conn.execute(sql3)
%>
mjpclab 2005-03-30
  • 打赏
  • 举报
回复
<%set rs=conn.execute("select * from pic where id="&id&")%> --你这里干吗加2个引号?

sql3="select * from pic where type='" & type & "'"
lxw81p 2005-03-30
  • 打赏
  • 举报
回复
还是不行!
jzywh 2005-03-30
  • 打赏
  • 举报
回复
sql3="select * from pic where type='" & type & "' "
lxw81p 2005-03-30
  • 打赏
  • 举报
回复
shit..我想问题已经解决!
lxw81p 2005-03-30
  • 打赏
  • 举报
回复
调试成功立即给分!!!

28,406

社区成员

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

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