缺少 'End' 
你的程序都有问题吧

解决方案 »

  1.   

    先告诉你一点要注意关闲对象时,先关闲recordset,再关闲Command.不然取不了记录集.
      

  2.   

    to beckhambobo(beckham):代码里未曾关闭任何对象,为何会报对象关闭错误?
    to penitent(只取一瓢);在asp里有错误都会报   “缺少 'End' ”错误。
      

  3.   

    Set recd.Source = CMD
    recd.Open
    recd.movefirst  '应当是这一句错了
    就是说,你的recd不存在,过程没有执行成功,但是你认为成功了.
      

  4.   

    if recd is nothing then
      response.write "recordset not exists'
      response.end
    end if
    if recd.eof then
      response.write "no record"
      response.end
    end if
      

  5.   

    to penitent(只取一瓢):我把这一句recd.movefirst  改成你的代码仍然报相同的错误,错误在 if recd.eof then 这一句上。请问为何?
      

  6.   

    在你的程序找不到这名:
    set recd = Server.CreateObject("ADODB.Recordset")
      

  7.   

    set recd = Server.CreateObject("ADODB.Recordset")
    放在包含文件里了。
      

  8.   

    那怎样关闲记录集呢?把resordset放在文件做法不赞成
      

  9.   

    to:beckhambobo(beckham):我也不知道怎么关闭记录集,可否用recd.close呢?
    把resordset放在文件是设计好的,我也没办法。
      

  10.   

    若肯定包测试没问题,其本上是resordset出了问题。或者不用文件设计,在程序中自定义一个吧,给你一个参考例子:<%@LANGUAGE="VBSCRIPT"%> 
    <!--#include file="Connections/conn.asp" -->
    <% 
    set cm1 = Server.CreateObject("ADODB.Command")
    cm1.ActiveConnection = MM_conn_STRING
    cm1.CommandType = 1
    cm1.CommandTimeout = 0
    cm1.Prepared = true
    cm1.CommandText = "{call pkg_test.get(?)}"//(?,{resultset 0, myrctype})
    set para = cm1.Parameters
    para.Append cm1.CreateParameter("p_id",3,1,,1)
    set rs = Server.CreateObject("ADODB.Recordset")
    //rs.CursorType = 0
    //rs.CursorLocation = 3
    //rs.LockType = 3
    //set rs.Source = cm1
    //rs.Open()
    set rs=cm1.Execute  
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>中山大学附属第五医院</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <LINK href="images/med.css" type=text/css rel=stylesheet>
    </head>
    <body bgcolor="#B2CFE4" text="#000000">
    <%
       while not rs.eof 
       response.write rs("name")
       rs.movenext()
       wend %></body>
    </html>
    <%
    rs.close
    cm1.ActiveConnection.Close
    set cm1=nothing
    %>
      

  11.   

    你的问题出在记录集上
    应当是你的存取过程执行失败了
    你的rs还是关闭状态
    所以rs.eof rs.move都会出错.
    而recd is nothing 检测不到,试试用isnull(recd)能不能检测到
    ---------------
    饿哦怀疑你的过程执行失败了.没有返回记录集过来
      

  12.   

    to penitent(只取一瓢) : 我在developer里运行了存储过程,成功,用了近5分钟,另外我试用了isnull(recd) ,没有运行条件里的内容,说明返回了记录集。to  beckhambobo(beckham) :我在asp里加上这两句:
    cm1.CommandTimeout = 0
    cm1.Prepared = true
    出现如下错误:
    Microsoft VBScript 编译器错误 错误 '800a03f6' 缺少 'End' /iisHelp/common/500-100.asp,行242 Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005' [Microsoft][ODBC driver for Oracle]无法绑定 PL/SQL 记录或游标引用 /wanzh/wwww/pifywcx/cangkjxccx.asp,行9797行即为: recd.Open   这一句两位再帮我看看,多谢了。
      

  13.   

    把它改成这样看怎样:
    cmd.CommandText  =    "{call  jinxdc1.jinxdcbb(?,?,?,?,?,)}"另外把包内容帖出来吧.
      

  14.   

    CREATE OR REPLACE PACKAGE "JINXDC1"    as
    type v_cursor is ref cursor;procedure jinxdcbb( in_huoh in xsdmk.huop.huoh%type,   
                        in_cangwh in xsxt.cangw.cangwh%type,  
                        in_dalh in xsdmk.huopdlb.dlh%type,   
                        in_qisrq in varchar2,    
                        in_zhongzrq in varchar2,  
                        out_cursor in out v_cursor); 
    end jinxdc1;
    CREATE OR REPLACE PACKAGE BODY "JINXDC1"  isprocedure jinxdcbb(in_huoh in xsdmk.huop.huoh%type,   
                        in_cangwh in xsxt.cangw.cangwh%type,  
                        in_dalh in xsdmk.huopdlb.dlh%type,   
                        in_qisrq in varchar2,    
                        in_zhongzrq in varchar2,  
                        out_cursor in out v_cursor )is   
     
                begin   
                  delete from xs_op.ghctemp;
                  delete from xs_op.ghctemp1;
          
                  insert into xs_op.ghctemp1(riq,hh,chuzje) 
                         select to_date(in_qisrq,'yyyy-mm-dd'),huoh,sum(qimsl)
                         from xsbb.ghcjxdcbb 
                         where (riq,cwh,huoh) in 
                         (select max(riq),cwh,huoh  from xsbb.ghcjxdcbb 
                         where cwh like in_cangwh and huoh like in_huoh
                         and riq<to_date(in_qisrq,'yyyy-mm-dd') group by huoh,cwh) 
                         group by huoh; 
                       
                  insert into xs_op.ghctemp1(riq,hh,qimje,zaitje,lingtsl) 
                         select to_date(in_qisrq,'yyyy-mm-dd'),huoh,sum(qimsl),sum(zaitsl),sum(lingtztsl)
                         from xsbb.ghcjxdcbb 
                         where (riq,cwh,huoh) in 
                         (select max(riq),cwh,huoh  from xsbb.ghcjxdcbb 
                         where cwh like in_cangwh and huoh like in_huoh
                         and riq<to_date(in_zhongzrq,'yyyy-mm-dd') group by huoh,cwh) 
                         group by huoh; 
                        
                 insert into xs_op.ghctemp1 (riq,hh,rukje,yirje,panyje,lingtje,pitje,tuigje,yicje,pankje,lingsyjje,lingsbjje,lingswjje,pisje) 
                        select to_date(in_qisrq,'yyyy-mm-dd'),huoh, sum(ruksl),sum(yirsl),sum(panysl),sum(lingtsl),sum(pitsl),sum(tuigsl),sum(yicsl), 
                        sum(panksl),sum(lingsyjsl),sum(lingsbjsl),sum(lingswjsl),sum(pissl)
                        from xsbb.ghcjxdcbb where riq between to_date(in_qisrq,'yyyy-mm-dd') and to_date(in_zhongzrq,'yyyy-mm-dd') 
                        and cwh like in_cangwh and huoh like in_huoh group by huoh ;
                        
                 insert into xs_op.ghctemp (riq,hh,chuzje,rukje,yirje,panyje,lingtje,pitje,tuigje,yicje,pankje, 
                        lingsyjje,lingsbjje,lingswjje,pisje,zaitje,qimje,bzje,lingtsl) 
                        (select to_date(in_qisrq,'yyyy-mm-dd'),hh,sum(chuzje), sum(rukje),sum(yirje),sum(panyje),
                        sum(lingtje),sum(pitje),sum(tuigje),sum(yicje),sum(pankje),sum(lingsyjje), sum(lingsbjje),
                        sum(lingswjje),sum(pisje),sum(zaitje),sum(qimje),sum(bzje),sum(lingtsl) 
                        from xs_op.ghctemp1  where  hh like in_huoh group by hh);
                        
                 delete xs_op.ghctemp where chuzje=0 and rukje=0 and yirje=0 and panyje=0 and lingtje=0 and pitje = 0 And tuigje = 0 
                        And yicje = 0 And pankje = 0 And lingsyjje = 0 And lingsbjje = 0 And lingswjje = 0 and pisje=0 and zaitje=0 
                        and qimje=0 and bzje=0 and lingtsl=0;      
                   
                 open   out_cursor for
                        select a.hh,b.huom, a.chuzje, a.rukje + a.yirje+ a.lingtje + a.pitje, 
                        a.tuigje+a.pisje +a.yicje +a.lingsyjje+a.lingsbjje, a.panyje-a.pankje ,a.qimje, a.zaitje ,a.lingtsl
                        from xs_op.ghctemp a,xsdmk.huop b  where b.dlh like in_dalh  and  a.hh=b.huoh  and a.hh like in_huoh  order by a.hh ;
                 
               
     end jinxdcbb;                   
         end jinxdc1;
      

  15.   

    我想你先把recd.movefirst注释掉看怎么样
    如果没有错,就是你的recd没有正常的得到记录集
    至于怎么没有得到记录集,还需要你自己查
    我想还是你没有得到记录集,
    developer里运行了存储过程,成功,不代表程序能成功
      

  16.   

    既然这样,还是把问题简单化吧,不要单独recordset共享,现在也不清楚它的参数设置。
    自已新建一个在程序代码中,再执行看结果怎样。多方面考虑。