风云小站|Connecting Lives With Infinite New Discoveries » 求助专区 » asp语法问题

asp语法问题

网事如风 中级会员
楼主 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
请各位大侠指教以下
谢谢
blackhand 风云元老
#1 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