日期:2014-05-17  浏览次数:20853 次

对象关闭,不允许操作
Const   MaxPerPage=20
      dim   totalPut      
      dim   CurrentPage
      dim   TotalPages
      dim   j
      dim   sql
      if   Not   isempty(SafeRequest( "page ",1))   then
                  currentPage=Cint(SafeRequest( "page ",1))
      else
            currentPage=1
      end   if  
set   rs=server.CreateObject( "adodb.recordset ")
select   case   a
                case   " "
                        rs.open   "select   id,namefrom   Shop   order   by   adddate   desc ",conn,1,1

              case   "index "
                        rs.open   "select   id,name,stock   from   Shop ",conn,1,1
end   select
if   rs.eof   And   rs.bof   then
提示   “if   rs.eof   And   rs.bof   then
”这一行对象关闭时,不允许操作。

------解决方案--------------------
select case a
case " "
rs.open "select id,namefrom Shop order by adddate desc ",conn,1,1

case "index "
rs.open "select id,name,stock from Shop ",conn,1,1
end select
if rs.eof And rs.bof then

你这儿a等于什么?如果不为空也不为index,比如等于 "aaa ",不是就没打开吗?用case else语句试试
------解决方案--------------------
rs.open "select id,namefrom Shop order by adddate desc ",conn,1,1

好像是
rs.open "select id,name from Shop order by adddate desc ",conn,1,1