title: How to get a value from stored procedure
body: <p>How to get a return value from store procedure, using <code>VB6</code> and <code>SQL Server</code>.</p>
  
  <p>Stored Procedure</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[DayAttn]
      @Attn VARCHAR(12) OUTPUT
  AS
  BEGIN
      SELECT @Attn = MAX(id)
      FROM   table1
  
      RETURN @Attn
  END
  </code></pre>
  
  <p>VB6</p>
  
  <pre><code>conn.Execute "exec DayAttn '" '" &amp; Attn &amp; "'"
  </code></pre>
  
  <p>The above code is showing an error.</p>