求教:存储过程 'getlinelist' 需要参数 '@tPageCount',但未提供该参数。
ASP代码
set rs=server.createobject("adodb.recordset")
    Set CmdSP = Server.CreateObject("ADODB.Command")   
    CmdSP.ActiveConnection =conn
    CmdSP.CommandText =  "dbo.getlinelist"
    CmdSP.CommandType=4   
    CmdSP.Prepared=true
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tRecordCount",3,4)
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tPageCount",3,4)
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tpagesize",3,1,6,tpagesize)       
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tpageno",3,1,6,PageNo)
  CmdSp.Parameters.Append CmdSp.CreateParameter("@fz",200,1,50,fenzhanming) 
      CmdSp.Parameters.Append CmdSp.CreateParameter("@fc",200,1,50,fc) 
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tc",200,1,50,tc)     
       
      
      tpagesize=15   
  PageNo=int(request("Page"))
  
      if PageNo="" or PageNo<=0 then PageNo=1
      Set  rs  =CmdSp.Execute      ''''''''''''''''''''''''''''''''''出错行
      rs.close  
   tRecordCount=CmdSp.parameters("@tRecordCount")
   tPageCount=CmdSp.parameters("@tPageCount")存储过程CREATE PROCEDURE [dbo].[getlinelist] 
@tRecordCount int output,
@tPageCount int output,
@tPageSize int,    
@tPageNo int,
@fz  varchar(50),
@fc  varchar(50),
@tc varchar(50)       AS
set nocount onbeginDECLARE @tStart int,@tEnd int       --设置起止标志
SET @tStart=(@tPageNo-1) * @tPageSize
SET @tEnd =@tStart+@tPageSize+1SELECT L.BiaoTi, L.GuestID,L.addtime,L.lineID, G.CoName, L.FromCity, L.ToCity, L.fenzhan,G.tel,G.phone,g.address,g.guestname
 FROM [dbo]. Line L INNER JOIN [dbo].Guest G ON L.GuestID = G.GuestID WHERE (L.FromCity = @fc) AND (L.ToCity = @tc) AND (L.Chk <> 0) AND (L.fenzhan = @fz) and (LineID > @tStart) AND (LineID < @tEnd) ORDER BY L.VIPLine DESC, L.PaiMing, L.AddTime DESC, L.LineID DESC
 
 set @tRecordCount = @@rowcount
 IF @tRecordCount%@tPageSize=0
    SET @tPageCount=CEILING(@tRecordCount/@tPageSize)
 ELSE
    SET @tPageCount=CEILING(@tRecordCount/@tPageSize)+1
  
return
end
GO

解决方案 »

  1.   

    set rs=server.createobject("adodb.recordset")
      Set CmdSP = Server.CreateObject("ADODB.Command")   
      CmdSP.ActiveConnection =conn
      CmdSP.CommandText = "dbo.getlinelist"
      CmdSP.CommandType=4   
      CmdSP.Prepared=true
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tRecordCount",3,4)
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tPageCount",3,4)
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tpagesize",3,1,6,tpagesize)   
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tpageno",3,1,6,PageNo)
    CmdSp.Parameters.Append CmdSp.CreateParameter("@fz",200,1,50,fenzhanming)  
      CmdSp.Parameters.Append CmdSp.CreateParameter("@fc",200,1,50,fc)  
      CmdSp.Parameters.Append CmdSp.CreateParameter("@tc",200,1,50,tc)   
        
        
      tpagesize=15    
    PageNo=int(request("Page"))
      
      if PageNo="" or PageNo<=0 then PageNo=1
      Set rs =CmdSp.Execute ''''''''''''''''''''''''''''''''''出错行
      rs.close   
      tRecordCount=CmdSp.parameters("@tRecordCount")
      tPageCount=CmdSp.parameters("@tPageCount")CREATE PROCEDURE [dbo].[getlinelist]  
    @tRecordCount int output,
    @tPageCount int output,
    @tPageSize int,   
    @tPageNo int,
    @fz varchar(50),
    @fc varchar(50),
    @tc varchar(50)   AS
    set nocount onbeginDECLARE @tStart int,@tEnd int --设置起止标志
    SET @tStart=(@tPageNo-1) * @tPageSize
    SET @tEnd =@tStart+@tPageSize+1SELECT L.BiaoTi, L.GuestID,L.addtime,L.lineID, G.CoName, L.FromCity, L.ToCity, L.fenzhan,G.tel,G.phone,g.address,g.guestname
     FROM [dbo]. Line L INNER JOIN [dbo].Guest G ON L.GuestID = G.GuestID WHERE (L.FromCity = @fc) AND (L.ToCity = @tc) AND (L.Chk <> 0) AND (L.fenzhan = @fz) and (LineID > @tStart) AND (LineID < @tEnd) ORDER BY L.VIPLine DESC, L.PaiMing, L.AddTime DESC, L.LineID DESC
      
     set @tRecordCount = @@rowcount
     IF @tRecordCount%@tPageSize=0
      SET @tPageCount=CEILING(@tRecordCount/@tPageSize)
     ELSE
      SET @tPageCount=CEILING(@tRecordCount/@tPageSize)+1
      
    return
    end
    GO貌似已经有参数了,但是参数方式貌似不对。。
      

  2.   

    @tRecordCount和@tPageCount是输出参数,你没定义参数类型是output类型吧