楼主 2007-04-23 09:40
asp语法问题
<% dim pyid
pyid=request.querystring("id")
if pyid="" or isnull(pyid) or isnumeric(pyid)<>true then
response.write"<script>alert('错误,请返回');history.back();</script>"
else
sql="select pytitle,pybody,pyimg from policy where id="&pyid
set rs=conn.execute(sql)
end if
if rs.eof then
response.write"<script>alert('对不起,您所要查询的对象不存在');history.back();</script>"
else
pytitle=rs("pytitle")
pybody=rs("pybody")
pyimg=rs("pyimg")
end if
%>
老是说缺少对象: 'rs'
才学的ASP
请各位大侠指教以下
谢谢
#1 2007-04-23 09:43
<% dim allsort
sql="select sort,id from allsort order by id"
set rs=conn.execute(sql)
allsort=rs.getrows
%>里面的 set rs=conn.execute(sql)也说缺少对象,谢谢各位了
#3 2007-04-23 14:45
换种方式试过么。
不用execute
直接最原始的
set rs=server.CreateObject("adodb.recordset")
rs.open "select pytitle,pybody,pyimg from policy where id="&pyid,conn,1,3