谁能举个在ASP页面中调用存储过程中的值的Stored procedure 例程,越简单越好。

解决方案 »

  1.   

    SQL 2000 books onlineBuilding SQL Server Applications
      ADO and SQL Server
        Executing Queries
          Executing Stored Procedures
            Using Return Code and Output Parameters for Stored Procedures
      

  2.   

    漏了一层Building SQL Server Applications
      ADO and SQL Server
        Programming ADO SQL Server Applications 
          Executing Queries
            Executing Stored Procedures
              Using Return Code and Output Parameters for Stored Procedures
      

  3.   

    我照MSDN的样例做了一个,提示错误如下:
    错误类型:
    ADODB.Command (0x800A0BB9)
    /account_salary_report.asp, 第 126 行
    就是这一行: cmdSalaryCulculate.Parameters.Append cmdSalaryCulculate.CreateParameter("WindNum", adInteger, adParamReturnValue)
      

  4.   

    GIVE YOU A EXAMPLE:CREATE PROCEDURE Usp_Registerlogin
            @loginname     nvarchar(50), 
            @password       nvarchar(30)         
    AS        declare @rc             int    /* SP return code   */
            set nocount on
            
    select @rc = 0        
            if @rc = 0
            begin
               if exists (select * from dbo.employees where cast(loginname as varbinary)=cast(@loginname  as varbinary)
    begin
    select @rc=0
    end
       else
    begin
    select @rc=-1
    return @rc
    end if exists (select * from dbo.employees where cast([password] as varbinary)=cast(@password 
    as varbinary))                  begin
    select @rc=0
    return @rc
      end
    else
      begin
    select @rc=-2        
     return @rc
      end
            end 
    GOASP CALL THIS SP
    ....
    returnvalue=au_adocmd.Parameters("RETURN_VALUE").Value
    if returnvalue=3 then
    ....
    conn.RollbackTrans
    end if
    ....