who can tell me this question?

解决方案 »

  1.   

    在.net里:
    create proc test
    @rr smallint
    as
    declare @r smallint
    select @r=count(f) from table1
     if @r>=2 
       @rr=@r
    else
       @rr=1
    return @rr
    gomySqlCommandText="execute @rr=test";......
      

  2.   

    在vb6中怎樣得到return語句的返值?
      

  3.   

    Dim cmd As New ADODB.Command
            Set cmd.ActiveConnection = g_cnnMain
            cmd.CommandText = "sp_name"
            cmd.CommandType = adCmdStoredProc
        
            cmd.Parameters.Append cmd.CreateParameter("RtnValue", adInteger, adParamReturnValue)        
            Call cmd.Execute
            
            MsgBox "返回值為:"+Str(cmd.Parameters.Item("RtnValue").Value)